Defined in: packages/ai/src/activities/chat/agents/define-agent.ts:59
A named child agent. run is a chat() call (or any stream of AG-UI chunks). TTools and TSchema stay on the object so useChat({ subagents }) can type that child's parts.
TName extends string = string
TTools extends ReadonlyArray<SubagentTool> = ReadonlyArray<SubagentTool>
TSchema extends SchemaInput | undefined = SchemaInput | undefined
TInterrupts extends ReadonlyArray<InterruptDefinition<any, any, any, any>> = ReadonlyArray<InterruptDefinition<any, any, any, any>>
TInput extends SchemaInput | undefined = any
description: string;Defined in: packages/ai/src/activities/chat/agents/define-agent.ts:69
Required here: the router and the synthetic tool both read it.
AGUISubagentInfo.descriptionoptional inputSchema?: TInput;Defined in: packages/ai/src/activities/chat/agents/define-agent.ts:82
The input this agent needs, such as a short brief. run reads it as ctx.input. In tool mode, the parent model writes it when it calls this agent's tool. 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.
optional interrupts?: TInterrupts;Defined in: packages/ai/src/activities/chat/agents/define-agent.ts:84
name: TName;Defined in: packages/ai/src/activities/chat/agents/define-agent.ts:67
Unique name or identifier of the subagent.
AGUISubagentInfo.nameoptional outputSchema?: TSchema;Defined in: packages/ai/src/activities/chat/agents/define-agent.ts:85
run: (ctx) =>
| AsyncIterable<AGUIEvent, any, any>
| Promise<AsyncIterable<AGUIEvent, any, any>>;Defined in: packages/ai/src/activities/chat/agents/define-agent.ts:70
SubagentRunContext<TInput>
| AsyncIterable<AGUIEvent, any, any> | Promise<AsyncIterable<AGUIEvent, any, any>>
optional subagents?: unknown;Defined in: packages/ai/src/activities/chat/agents/define-agent.ts:86
optional tools?: TTools;Defined in: packages/ai/src/activities/chat/agents/define-agent.ts:83