Skip to content
Source
Sign inSign up
TanStack/ai
Open History to see the last commit

SubagentRunInput.md

127 lines3.3 KB

Defined in: packages/ai/src/activities/chat/agents/define-agent.ts:20

What the library knows about a child run before run starts. TInput is the agent's inputSchema.

Type Parameters

TInput

TInput extends SchemaInput | undefined = any

Properties

abortSignal?

optional abortSignal?: AbortSignal;

Defined in: packages/ai/src/activities/chat/agents/define-agent.ts:29


input

input: TInput extends SchemaInput ? InferSchemaType<TInput> : undefined;

Defined in: packages/ai/src/activities/chat/agents/define-agent.ts:27

The input the parent model or the router gave this child, checked against inputSchema. undefined when the agent has no inputSchema.


messages

messages: (
  | UIMessage<unknown>
  | ModelMessage<
  | string
  | ContentPart<unknown, unknown, unknown, unknown, unknown>[]
  | null>)[];

Defined in: packages/ai/src/activities/chat/agents/define-agent.ts:28


parentRunId

parentRunId: string;

Defined in: packages/ai/src/activities/chat/agents/define-agent.ts:38

The run this child run continues. It is the parent chat run on the first run, and the interrupted parent run on a resume. Pass it to the child chat().


parentSubagentRunId?

optional parentSubagentRunId?: string;

Defined in: packages/ai/src/activities/chat/agents/define-agent.ts:48

The subagentRunId of the child that started this one, for a nested child.


resume?

optional resume?: RunAgentResumeItem[];

Defined in: packages/ai/src/activities/chat/agents/define-agent.ts:40

Answers to this child's interrupts. Pass it to the child chat().


runId

runId: string;

Defined in: packages/ai/src/activities/chat/agents/define-agent.ts:32

Run id for the child chat().


subagentRunId

subagentRunId: string;

Defined in: packages/ai/src/activities/chat/agents/define-agent.ts:46

The child's AG-UI run id. Stays the same when an interrupted child continues. Pass it to the child chat() so its middleware sees ctx.subagentRunId.


threadId

threadId: string;

Defined in: packages/ai/src/activities/chat/agents/define-agent.ts:30