本页还没有译文
本页 43 段还没译成Français,下面显示的是英文原文。ModelMessage
还没翻译译自英文(tanstack.com)本页 43 段都还没译
Defined in: packages/ai/src/types.ts:428
Type Parameters
TContent
TContent extends string | null | ContentPart[] = string | null | ContentPart[]
Properties
blockOrder?
optional blockOrder?: ModelMessageBlock[];Defined in: packages/ai/src/types.ts:452
The order of the blocks of an assistant message, when it is not the
default order (all thinking, then the text, then the tool calls). Each
entry points into thinking, into content (a string, by UTF-16 length),
or into toolCalls. The library writes and reads this field. A reader
that finds a map that does not match the message uses the default order.
content
content: TContent;Defined in: packages/ai/src/types.ts:435
createdAt?
optional createdAt?: Date;Defined in: packages/ai/src/types.ts:482
Optional message creation timestamp. When present, message converters preserve it across persist → hydrate round-trips.
error?
optional error?: string;Defined in: packages/ai/src/types.ts:454
Error reported by an AG-UI tool message.
id?
optional id?: string;Defined in: packages/ai/src/types.ts:477
Optional stable message id. Providers ignore it; it exists so a persisted
transcript can retain the streaming messageId and survive the
persist → hydrate round-trip. When present, modelMessagesToUIMessages
reuses it instead of generating a fresh id, so a hydrated message keeps the
same identity as its live stream — which is what lets a mid-stream reload
resume the SAME message bubble in place (see @tanstack/ai-persistence).
metadata?
optional metadata?: Record<string, any>;Defined in: packages/ai/src/types.ts:462
Optional AG-UI message metadata. TanStack-owned fields live under tanstack.
midConversationChange?
optional midConversationChange?: MidConversationChange;Defined in: packages/ai/src/types.ts:460
The tools and system prompts that changed before this assistant message.
chat() writes it when the adapter has a mid-conversation channel.
Providers ignore it: adapters read TextOptions.midConversationChanges.
name?
optional name?: string;Defined in: packages/ai/src/types.ts:436
role
role: "assistant" | "user" | "tool";Defined in: packages/ai/src/types.ts:434
structuredOutput?
optional structuredOutput?: StructuredOutputPart<unknown>;Defined in: packages/ai/src/types.ts:468
Completed structured output represented by this assistant message.
content remains the provider-facing JSON text; this field preserves the
typed UI part across persistence and message conversion.
thinking?
optional thinking?: object[];Defined in: packages/ai/src/types.ts:444
Signed thinking to send back to the provider. redacted: true marks a
block the provider encrypted: content is empty and signature holds its
opaque data. See ThinkingPart.signature for the planned rename.
content
content: string;redacted?
optional redacted?: boolean;signature?
optional signature?: string;toolCallId?
optional toolCallId?: string;Defined in: packages/ai/src/types.ts:438
toolCalls?
optional toolCalls?: ToolCall<unknown>[];Defined in: packages/ai/src/types.ts:437