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

SubagentRouteOptions.md

40 lines1.2 KB

1---
2id: SubagentRouteOptions
3title: SubagentRouteOptions
4---
5​
6Defined in: [packages/ai/src/activities/chat/agents/route.ts:7](https://github.com/TanStack/ai/blob/main/packages/ai/src/activities/chat/agents/route.ts#L7)
7​
8## Type Parameters
9​
10### TAgents
11​
12`TAgents` *extends* `ReadonlyArray`\<[`DefinedAgent`](DefinedAgent.md)\>
13​
14## Properties
15​
16### then?
17​
18```ts
19optional then?: readonly TAgents[number]["name"][];
20```
21​
22Defined in: [packages/ai/src/activities/chat/agents/route.ts:21](https://github.com/TanStack/ai/blob/main/packages/ai/src/activities/chat/agents/route.ts#L21)
23​
24Agents that run after the other selected agents. The lead group starts
25together. The `then` agents then run one after another in list order, and
26each reads the text so far. Used only when the router picks at least one
27agent from each group. Otherwise `pick` returns `{ names, order }`.
28​
29***
30​
31### when?
32​
33```ts
34optional when?: { [K in string]: string };
35```
36​
37Defined in: [packages/ai/src/activities/chat/agents/route.ts:14](https://github.com/TanStack/ai/blob/main/packages/ai/src/activities/chat/agents/route.ts#L14)
38​
39Question text for every agent. The key is the agent name.
40Omit this and each question uses that agent's description.