Skip to main content

Interface: ChatMessage

Defined in: core/dist/types/types/messages.d.ts:60

Normalized chat message format across all providers

Properties​

approvalRequests?​

optional approvalRequests?: object[]

Defined in: core/dist/types/types/messages.d.ts:109

For assistant messages that paused on a tool-approval gate (resumable approvals). Preserving these across a round-trip lets AI SDK match a tool-approval-response back to its originating tool call so the tool loop resumes. Set when re-supplying a paused turn as conversationHistory.

approvalId​

approvalId: string

toolCallId​

toolCallId: string


content​

content: string | MessageContentBlock[]

Defined in: core/dist/types/types/messages.d.ts:62


interruptRequests?​

optional interruptRequests?: InterruptRequest[]

Defined in: core/dist/types/types/messages.d.ts:102

Pending askHuman requests, retained for local tool replay on resume.


rawContent?​

optional rawContent?: object[]

Defined in: core/dist/types/types/messages.d.ts:114

Raw content blocks in provider-specific format (e.g., Anthropic's tool_use blocks)

id?​

optional id?: string

input?​

optional input?: unknown

name?​

optional name?: string

signature?​

optional signature?: string

text?​

optional text?: string

thinking?​

optional thinking?: string

type​

type: "text" | "thinking" | "tool_use"


reasoning?​

optional reasoning?: object[]

Defined in: core/dist/types/types/messages.d.ts:71

For assistant messages: the step's reasoning blocks as the provider sent them (text, provider metadata such as an Anthropic signature, and who produced them). Sent back only to the same provider and model; any other model gets the message without them (a mismatched signature is a 400).

producer?​

optional producer?: object

producer.model​

model: string

producer.provider​

provider: string

providerMetadata?​

optional providerMetadata?: Record<string, unknown>

text​

text: string


role​

role: MessageRole

Defined in: core/dist/types/types/messages.d.ts:61


tool_call_id?​

optional tool_call_id?: string

Defined in: core/dist/types/types/messages.d.ts:64

For tool messages: the ID of the tool call this is responding to


tool_calls?​

optional tool_calls?: object[]

Defined in: core/dist/types/types/messages.d.ts:86

For assistant messages with tool calls (OpenAI format)

function​

function: object

function.arguments​

arguments: string

function.name​

name: string

id​

id: string

producer?​

optional producer?: object

producer.model​

model: string

producer.provider​

provider: string

providerMetadata?​

optional providerMetadata?: Record<string, unknown>

The provider's metadata on the call as the model produced it, and who produced it (resent to that model only).

result?​

optional result?: unknown

type​

type: "function"


toolOutput?​

optional toolOutput?: unknown

Defined in: core/dist/types/types/messages.d.ts:84

For tool messages: the AI SDK tool-result output to send as it is ({ type: 'content', value: [...] } holding Anthropic tool references, say), in place of content parsed as JSON or text.