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
- ApprovalRequestedStreamChunk
- 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
- StreamChunkType
- ToolCallState
- ToolResultState
Variable References
SubagentBinding
Defined in: packages/ai/src/activities/chat/agents/bound.ts:45
What a host adds to every activity call an agent makes through ctx. Apps using plain chat({ subagents }) do not set it.
Properties#
budget?#
optional budget?: SubagentBudget;Defined in: packages/ai/src/activities/chat/agents/bound.ts:60
The subagent tree budget. A child's ctx.chat({ subagents }) passes it down, so limits hold across the whole tree.
chatMiddleware?#
optional chatMiddleware?: readonly AnyChatMiddleware[];Defined in: packages/ai/src/activities/chat/agents/bound.ts:50
Added before the call's own middleware on every ctx.chat call. A child's ctx.chat({ subagents }) passes it down to its own children.
generationMiddleware?#
optional generationMiddleware?: readonly GenerationMiddleware<unknown>[];Defined in: packages/ai/src/activities/chat/agents/bound.ts:55
Added before the call's own middleware on every generation call. A child's ctx.chat({ subagents }) passes it down to its own children.
keys?#
optional keys?: ProviderKeys;Defined in: packages/ai/src/activities/chat/agents/bound.ts:66
The provider keys an agent reads as ctx.keys. subagents.keys sets them. A child's ctx.chat({ subagents }) passes them down to its own children. Without them, ctx.keys reads each provider's env names.
promptCache?#
optional promptCache?: PromptCacheRetention;Defined in: packages/ai/src/activities/chat/agents/bound.ts:71
The prompt cache retention of the parent call. A child's ctx.chat() uses it when the call gives no promptCache.
start?#
optional start?: (call, options) => Promise<{
done: Promise<unknown>;
subagentRunId: string;
}>;Defined in: packages/ai/src/activities/chat/agents/bound.ts:78
Starts a child without waiting for it and returns its id at once. The agent tools call it for background: true. With wake: true, the host starts a new parent turn when the child ends. It does not pass down to nested children.
Parameters#
call#
agent#
string
input?#
unknown
parentToolCallId?#
string
prompt?#
string
options#
wake#
true
Returns#
Promise<{ done: Promise<unknown>; subagentRunId: string; }>