ChatMessage schema

FieldType and description
role
Required
string

The role of the message author.

Allowed values: ["system","user","assistant","tool"]

content
Required
schema

The message content (text or multimodal content parts). Assistant tool-call messages may contain content: null.

oneOf
string
array of object
Array itemsobject
null
reasoning_contentstring | null

The model's reasoning trace when the model produces one; null otherwise. Populated by some reasoning models only — a consumer must not assume it carries content. Reasoning that a model writes inside content between <think> or <thinking> tags is moved here, with or without streaming.

namestring

Optional name for the participant.

tool_callsarray of object

Tool calls generated by the assistant.

Array itemsobject
tool_call_idstring

ID of the tool call this message responds to.