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

SubagentRunInput.md

127 lines2.3 KB

1---
2id: SubagentRunInput
3title: SubagentRunInput
4---
5​
6Defined in: packages/ai/src/activities/chat/agents/define-agent.ts:20
7​
8What the library knows about a child run before `run` starts.
9`TInput` is the agent's `inputSchema`.
10​
11## Type Parameters
12​
13### TInput
14​
15`TInput` *extends* [`SchemaInput`](../type-aliases/SchemaInput.md) \| `undefined` = `any`
16​
17## Properties
18​
19### abortSignal?
20​
21```ts
22optional abortSignal?: AbortSignal;
23```
24​
25Defined in: packages/ai/src/activities/chat/agents/define-agent.ts:29
26​
27***
28​
29### input
30​
31```ts
32input: TInput extends SchemaInput ? InferSchemaType<TInput> : undefined;
33```
34​
35Defined in: packages/ai/src/activities/chat/agents/define-agent.ts:27
36​
37The input the parent model or the router gave this child, checked
38against `inputSchema`. `undefined` when the agent has no `inputSchema`.
39​
40***
41​
42### messages
43​
44```ts
45messages: (
46 | UIMessage<unknown>
47 | ModelMessage<
48 | string
49 | ContentPart<unknown, unknown, unknown, unknown, unknown>[]
50 | null>)[];
51```
52​
53Defined in: packages/ai/src/activities/chat/agents/define-agent.ts:28
54​
55***
56​
57### parentRunId
58​
59```ts
60parentRunId: string;
61```
62​
63Defined in: packages/ai/src/activities/chat/agents/define-agent.ts:38
64​
65The run this child run continues. It is the parent chat run on the first
66run, and the interrupted parent run on a resume. Pass it to the child
67`chat()`.
68​
69***
70​
71### parentSubagentRunId?
72​
73```ts
74optional parentSubagentRunId?: string;
75```
76​
77Defined in: packages/ai/src/activities/chat/agents/define-agent.ts:48
78​
79The subagentRunId of the child that started this one, for a nested child.
80​
81***
82​
83### resume?
84​
85```ts
86optional resume?: RunAgentResumeItem[];
87```
88​
89Defined in: packages/ai/src/activities/chat/agents/define-agent.ts:40
90​
91Answers to this child's interrupts. Pass it to the child `chat()`.
92​
93***
94​
95### runId
96​
97```ts
98runId: string;
99```
100​
101Defined in: packages/ai/src/activities/chat/agents/define-agent.ts:32
102​
103Run id for the child `chat()`.
104​
105***
106​
107### subagentRunId
108​
109```ts
110subagentRunId: string;
111```
112​
113Defined in: packages/ai/src/activities/chat/agents/define-agent.ts:46
114​
115The child's AG-UI run id. Stays the same when an interrupted child
116continues. Pass it to the child `chat()` so its middleware sees
117`ctx.subagentRunId`.
118​
119***
120​
121### threadId
122​
123```ts
124threadId: string;
125```
126​
127Defined in: packages/ai/src/activities/chat/agents/define-agent.ts:30