Skip to content

Interface: ChatMessage

A single chat message. content is nullable because an assistant turn that only calls tools carries content: null.

optional content?: string | ChatContentPart[] | null


optional name?: string


role: string

See ChatRole for the standard values; widened for provider extensions.


optional tool_call_id?: string

Set on a tool turn, keying it back to the call it answers.


optional tool_calls?: ChatToolCall[]