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
StructuredOutputCompleteEvent
Defined in: packages/ai/src/types.ts:1777
Final event of a streaming structured-output run. Carries the validated object (typed as T after the orchestrator runs Standard Schema parsing), the raw JSON text that produced it, and — for thinking/reasoning models — the accumulated reasoning text. Adapters emit this with T = unknown; the chat orchestrator narrows to the schema's inferred type after validation.
reasoning is undefined when the model produced none (most non-thinking models) and when the underlying adapter doesn't expose reasoning streams.
name is a string literal so consumers can narrow directly:
if (chunk.type === 'CUSTOM' && chunk.name === 'structured-output.complete') {
chunk.value.object // typed as T
}Extends#
Type Parameters#
T#
T = unknown
Properties#
metadata?#
optional metadata?: Record<string, any>;Defined in: packages/ai/src/types.ts:1756
Extra information attached to this event.
Inherited from#
name#
name: "structured-output.complete";Defined in: packages/ai/src/types.ts:1780
What this custom event is. Required: without it a consumer cannot route the value.
Overrides#
CustomEvent.nametype#
type: "CUSTOM";Defined in: packages/ai/src/types.ts:1755
Inherited from#
value#
value: object;Defined in: packages/ai/src/types.ts:1781
The payload. Any JSON value, and required.
object#
object: T;raw#
raw: string;reasoning?#
optional reasoning?: string;Overrides#
CustomEvent.value