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

researcher-agent.ts

17 lines626 Bytes

1import { z } from 'zod'
2​
3// Shared by the server and the browser, so it holds no server code. The
4// server adds `run` in `routes/api.subagent-brief.ts`. The browser passes it
5// to `useChat`, which types `part.subagent.input` from `inputSchema`.
6export const researcher = {
7 name: 'researcher',
8 description:
9 'Researches one focused question and returns short findings. It cannot see this chat, so the task must hold every detail it needs.',
10 inputSchema: z.object({
11 task: z
12 .string()
13 .describe(
14 'What to find and what to return. The researcher sees only this text.',
15 ),
16 }),
17} as const