function subagentRoute<TAgents>(agents, options?): object;Defined in: packages/ai/src/activities/chat/agents/route.ts:53
Build decide() questions for a subagent router.
One yes/no question per agent, plus an order choice. pick returns main, one name, { names, order }, or { steps }. Names follow the agents array order. { names, order } overrides subagents.order for that turn. then: agents that run after the other selected agents. The lead group starts together. The then agents then run one after another in list order, and each reads the text so far. Used only when the router picks at least one agent from each group. Otherwise pick returns { names, order }.
TAgents extends readonly DefinedAgent<string, readonly SubagentTool[], SchemaInput | undefined, readonly InterruptDefinition<any, any, any, any, any>[]>[]
TAgents
SubagentRouteOptions<TAgents>
object
pick: (result) => SubagentRouterPick;RouteAnswers<TAgents>
questions: RouteQuestions<TAgents>;