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
WebSocketStreamInit
Defined in: packages/ai/src/stream-to-websocket.ts:90
Type Parameters#
TOffset#
TOffset extends string = string
Properties#
batch?#
optional batch?: number;Defined in: packages/ai/src/stream-to-websocket.ts:96
Chunks buffered per durability append (default 32).
batchWaitMs?#
optional batchWaitMs?: number;Defined in: packages/ai/src/stream-to-websocket.ts:101
Most ms a chunk waits in the batch for the next one before the batch is appended and sent anyway (default 50). 0 appends every chunk on its own.
debug?#
optional debug?: DebugOption;Defined in: packages/ai/src/stream-to-websocket.ts:110
durability?#
optional durability?: (ctx) => StreamDurability<TOffset>;Defined in: packages/ai/src/stream-to-websocket.ts:94
Per-TURN durability factory, keyed by the frame's runId via ctx.request.
Parameters#
ctx#
Returns#
StreamDurability<TOffset>
heartbeatMs?#
optional heartbeatMs?: number;Defined in: packages/ai/src/stream-to-websocket.ts:103
Heartbeat ping interval in ms (default 30_000).
idleTimeoutMs?#
optional idleTimeoutMs?: number;Defined in: packages/ai/src/stream-to-websocket.ts:109
Close after this many ms without any inbound frame (default 300_000). Never fires while a turn is still streaming, so a long single generation (agentic loop, >5-min turn) is safe.
onRun#
onRun: (ctx) => AsyncIterable<AGUIEvent>;Defined in: packages/ai/src/stream-to-websocket.ts:92
Build a fresh chat() stream for each inbound RunAgentInput frame.
Parameters#
ctx#
Returns#
AsyncIterable<AGUIEvent>