Class References
Function References
- text
- textOptions
- combineStrategies
- convertMessagesToModelMessages
- convertZodToJsonSchema
- createReplayStream
- embedding
- generateMessageId
- maxIterations
- messages
- modelMessageToUIMessage
- modelMessagesToUIMessages
- normalizeToUIMessage
- parsePartialJSON
- summarize
- toServerSentEventsStream
- toServerSentEventsResponse
- toolDefinition
- uiMessageToModelMessages
- realtimeToken
- untilFinishReason
Interface References
- AIAdapter
- AIAdapterConfig
- AgentLoopState
- AudioPart
- AudioVisualization
- BaseStreamChunk
- TextCompletionChunk
- TextOptions
- ChunkRecording
- ChunkStrategy
- ClientTool
- ContentPartSource
- ContentStreamChunk
- DefaultMessageMetadataByModality
- DocumentPart
- DoneStreamChunk
- EmbeddingOptions
- EmbeddingResult
- ErrorStreamChunk
- ImagePart
- InternalToolCallState
- JSONParser
- ModelMessage
- ProcessorResult
- ProcessorState
- RealtimeAdapter
- RealtimeClientOptions
- RealtimeConnection
- RealtimeMessage
- RealtimeSessionConfig
- RealtimeToken
- RealtimeTokenAdapter
- RealtimeTokenOptions
- ResponseFormat
- ServerTool
- StreamProcessorEvents
- StreamProcessorHandlers
- StreamProcessorOptions
- SummarizationOptions
- SummarizationResult
- TextPart
- ThinkingPart
- ThinkingStreamChunk
- Tool
- ToolCall
- ToolCallPart
- ToolCallStreamChunk
- ToolConfig
- ToolDefinition
- ToolDefinitionConfig
- ToolDefinitionInstance
- ToolInputAvailableStreamChunk
- ToolResultPart
- ToolResultStreamChunk
- UIMessage
- VideoPart
Type Alias References
- AgentLoopStrategy
- AnyClientTool
- TextStreamOptionsForModel
- TextStreamOptionsUnion
- ConstrainedContent
- ConstrainedModelMessage
- ContentPart
- ContentPartForModalities
- ExtractModalitiesForModel
- ExtractModelsFromAdapter
- InferToolInput
- InferToolName
- InferToolOutput
- MessagePart
- RealtimeEvent
- RealtimeMessagePart
- RealtimeMode
- RealtimeStatus
- ModalitiesArrayToUnion
- Modality
- StreamChunk
- ToolCallState
- ToolResultState
Variable References
TanStackMessageMetadata
Defined in: packages/ai/src/types.ts:699
Shape of metadata.tanstack on a message. createdAt is an ISO-8601 string.
Properties#
continues?#
optional continues?: string;Defined in: packages/ai/src/types.ts:751
On an assistant wire row that exists only to keep the block order: the id of the assistant row before it. Our server joins the two rows into one message with a blockOrder map. See uiMessagesToWire.
createdAt?#
optional createdAt?: string;Defined in: packages/ai/src/types.ts:700
finishReason?#
optional finishReason?: "length" | "stop" | "content_filter" | "tool_calls" | null;Defined in: packages/ai/src/types.ts:709
Why the model call of this assistant message ended. A 'length' message stopped at the output limit, so its tool calls are not complete.
model?#
optional model?: string;Defined in: packages/ai/src/types.ts:701
responseId?#
optional responseId?: string;Defined in: packages/ai/src/types.ts:704
responseItems?#
optional responseItems?: object[];Defined in: packages/ai/src/types.ts:715
The provider's answer items of this assistant message, in order, for a same-model replay. The OpenAI Responses adapter keeps each output message item's id and phase (commentary or final_answer).
id#
id: string;phase?#
optional phase?: string;run?#
optional run?: object;Defined in: packages/ai/src/types.ts:723
The chat run that produced this assistant message. withPersistence sets id. reconstructChat with includeRuns: true adds the finished run's timings, in epoch ms.
finishedAt?#
optional finishedAt?: number;id#
id: string;startedAt?#
optional startedAt?: number;runId?#
optional runId?: string;Defined in: packages/ai/src/types.ts:717
Parent chat run that produced this assistant message.
signature?#
optional signature?: string;Defined in: packages/ai/src/types.ts:727
Thinking signature for a role: 'reasoning' fan-out message.
source?#
optional source?: MessageSource;Defined in: packages/ai/src/types.ts:702
stopReason?#
optional stopReason?: "error" | "aborted";Defined in: packages/ai/src/types.ts:703
structuredOutput?#
optional structuredOutput?: object;Defined in: packages/ai/src/types.ts:737
data?#
optional data?: unknown;errorMessage?#
optional errorMessage?: string;partial?#
optional partial?: unknown;raw?#
optional raw?: string;reasoning?#
optional reasoning?: string;status?#
optional status?: "error" | "complete" | "streaming";subagent?#
optional subagent?: SubagentWireInfo;Defined in: packages/ai/src/types.ts:725
Card data on a child wire message. See uiMessagesToWire.
toolCallMetadata?#
optional toolCallMetadata?: Record<string, unknown>;Defined in: packages/ai/src/types.ts:729
Per-tool-call provider metadata keyed by tool call id (e.g. Gemini thoughtSignature).
toolResult?#
optional toolResult?: object;Defined in: packages/ai/src/types.ts:730
content?#
optional content?: ContentPart<unknown, unknown, unknown, unknown, unknown>[];createdAt?#
optional createdAt?: string;id?#
optional id?: string;toolResultOutcome?#
optional toolResultOutcome?: ToolResultOutcome;Defined in: packages/ai/src/types.ts:736
Outcome of a cancelled or denied tool result; when present, the UI state is error.
uiResources?#
optional uiResources?: UIResourcePart[];Defined in: packages/ai/src/types.ts:745