Interface: ChatMessage
Defined in: core/dist/types/types/messages.d.ts:60
Normalized chat message format across all providers
Properties
approvalRequests?
optionalapprovalRequests?: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?
optionalinterruptRequests?:InterruptRequest[]
Defined in: core/dist/types/types/messages.d.ts:102
Pending askHuman requests, retained for local tool replay on resume.
rawContent?
optionalrawContent?: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?
optionalid?:string
input?
optionalinput?:unknown
name?
optionalname?:string
signature?
optionalsignature?:string
text?
optionaltext?:string
thinking?
optionalthinking?:string
type
type:
"text"|"thinking"|"tool_use"
reasoning?
optionalreasoning?: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?
optionalproducer?:object
producer.model
model:
string
producer.provider
provider:
string
providerMetadata?
optionalproviderMetadata?:Record<string,unknown>
text
text:
string
role
role:
MessageRole
Defined in: core/dist/types/types/messages.d.ts:61
tool_call_id?
optionaltool_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?
optionaltool_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?
optionalproducer?:object
producer.model
model:
string
producer.provider
provider:
string
providerMetadata?
optionalproviderMetadata?: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?
optionalresult?:unknown
type
type:
"function"
toolOutput?
optionaltoolOutput?: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.