Skip to content

AIDK API Reference / aidk-server / messagesToTimeline

Function: messagesToTimeline() ​

ts
function messagesToTimeline(messages: 
  | {
  content: {
   [key: string]: unknown;
     imageUrl?: string;
     text?: string;
     type?: string;
  }[];
  metadata?: Record<string, unknown>;
  role: string;
}[]
  | undefined): COMTimelineEntry[];

Defined in: packages/server/src/execution-context.ts:159

Transform standard message format to Engine timeline. Uses loose typing to handle various frontend message formats.

Parameters ​

ParameterType
messages| { content: { [key: string]: unknown; imageUrl?: string; text?: string; type?: string; }[]; metadata?: Record<string, unknown>; role: string; }[] | undefined

Returns ​

COMTimelineEntry[]

Released under the MIT License.