Skip to main content

Interface: ChatMessage

Defined in: packages/core/src/providers/types.ts:334

Normalized chat message format across all providers

Properties

approvalRequests?

optional approvalRequests?: object[]

Defined in: packages/core/src/providers/types.ts:355

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: packages/core/src/providers/types.ts:336


rawContent?

optional rawContent?: object[]

Defined in: packages/core/src/providers/types.ts:357

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" | "tool_use" | "thinking"


role

role: MessageRole

Defined in: packages/core/src/providers/types.ts:335


tool_call_id?

optional tool_call_id?: string

Defined in: packages/core/src/providers/types.ts:338

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


tool_calls?

optional tool_calls?: object[]

Defined in: packages/core/src/providers/types.ts:340

For assistant messages with tool calls (OpenAI format)

function

function: object

function.arguments

arguments: string

function.name

name: string

id

id: string

result?

optional result?: unknown

type

type: "function"