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
DefinedAgent
Defined in: packages/ai/src/activities/chat/agents/define-agent.ts:110
A named child agent. run is a chat() call (or any stream of AG-UI chunks), or a promise of a plain value such as an image result. A chat({ stream: false }) result counts as its text. TTools and TSchema stay on the object so useChat({ subagents }) can type that child's parts. TResult is the value a promise run resolves to.
Extends#
- SubagentInfo
Type Parameters#
TName#
TName extends string = string
TTools#
TTools extends ReadonlyArray<SubagentTool> = ReadonlyArray<SubagentTool>
TSchema#
TSchema extends SchemaInput | undefined = SchemaInput | undefined
TInterrupts#
TInterrupts extends ReadonlyArray<InterruptDefinition<any, any, any, any>> = ReadonlyArray<InterruptDefinition<any, any, any, any>>
TInput#
TInput extends SchemaInput | undefined = any
TResult#
TResult = unknown
TProduces#
TProduces extends AgentProduces | undefined = AgentProduces | undefined
Properties#
description#
description: string;Defined in: packages/ai/src/activities/chat/agents/define-agent.ts:122
Required here: the router and the synthetic tool both read it.
Overrides#
AGUISubagentInfo.descriptioninputSchema?#
optional inputSchema?: TInput;Defined in: packages/ai/src/activities/chat/agents/define-agent.ts:142
The input this agent needs, such as a short brief. run reads it as ctx.input, and the client card as part.subagent.input. In tool mode, the parent model writes it when it calls this agent's tool. Without it, the tool takes a text prompt. When the run uses sessionId or background, that name is reserved. A subagents.router gives it in its pick as { name, input }. The input is checked against this schema first. A router can start this agent only when the schema is a Standard Schema, such as a zod schema. A plain JSON Schema works in tool mode only. A turn with a router input cannot resume after an interrupt.
interrupts?#
optional interrupts?: TInterrupts;Defined in: packages/ai/src/activities/chat/agents/define-agent.ts:144
name#
name: TName;Defined in: packages/ai/src/activities/chat/agents/define-agent.ts:120
Unique name or identifier of the subagent.
Overrides#
AGUISubagentInfo.nameoutputSchema?#
optional outputSchema?: TSchema;Defined in: packages/ai/src/activities/chat/agents/define-agent.ts:145
produces?#
optional produces?: TProduces;Defined in: packages/ai/src/activities/chat/agents/define-agent.ts:130
What this agent makes. See AgentProduces.
run#
run: (ctx) =>
| AsyncIterable<AGUIEvent, any, any>
| Promise<AsyncIterable<AGUIEvent, any, any>>
| Promise<TResult>;Defined in: packages/ai/src/activities/chat/agents/define-agent.ts:123
Parameters#
ctx#
SubagentRunContext<TInput>
Returns#
| AsyncIterable<AGUIEvent, any, any> | Promise<AsyncIterable<AGUIEvent, any, any>> | Promise<TResult>
subagents?#
optional subagents?: unknown;Defined in: packages/ai/src/activities/chat/agents/define-agent.ts:146
tools?#
optional tools?: TTools;Defined in: packages/ai/src/activities/chat/agents/define-agent.ts:143