docs: update examples section with Vercel AI SDK demo and fix count

- Add with-vercel-ai-sdk to recommended examples list in both READMEs
- EN: 16 scripts -> 16 scripts + 1 full-stack demo
- ZH: fix count from 15 to 16, add full-stack demo
This commit is contained in:
JackChen 2026-04-16 01:48:28 +08:00
parent 1cc43eba6e
commit 34b911825a
2 changed files with 6 additions and 4 deletions

View File

@ -139,14 +139,15 @@ For MapReduce-style fan-out without task dependencies, use `AgentPool.runParalle
## Examples ## Examples
16 runnable scripts in [`examples/`](./examples/). Start with these four: 16 runnable scripts and 1 full-stack demo in [`examples/`](./examples/). Start with these:
- [02 — Team Collaboration](examples/02-team-collaboration.ts): `runTeam()` coordinator pattern. - [02 — Team Collaboration](examples/02-team-collaboration.ts): `runTeam()` coordinator pattern.
- [06 — Local Model](examples/06-local-model.ts): Ollama and Claude in one pipeline via `baseURL`. - [06 — Local Model](examples/06-local-model.ts): Ollama and Claude in one pipeline via `baseURL`.
- [09 — Structured Output](examples/09-structured-output.ts): any agent returns Zod-validated JSON. - [09 — Structured Output](examples/09-structured-output.ts): any agent returns Zod-validated JSON.
- [11 — Trace Observability](examples/11-trace-observability.ts): `onTrace` spans for LLM calls, tools, and tasks. - [11 — Trace Observability](examples/11-trace-observability.ts): `onTrace` spans for LLM calls, tools, and tasks.
- [with-vercel-ai-sdk](examples/with-vercel-ai-sdk/): Next.js app — OMA `runTeam()` + AI SDK `useChat` streaming.
Run any with `npx tsx examples/02-team-collaboration.ts`. Run scripts with `npx tsx examples/02-team-collaboration.ts`.
## Architecture ## Architecture

View File

@ -137,14 +137,15 @@ Tokens: 12847 output tokens
## 示例 ## 示例
[`examples/`](./examples/) 里有 15 个可运行脚本。推荐从这 4 个开始: [`examples/`](./examples/) 里有 16 个可运行脚本和 1 个完整项目。推荐从这几个开始:
- [02 — 团队协作](examples/02-team-collaboration.ts)`runTeam()` 协调者模式。 - [02 — 团队协作](examples/02-team-collaboration.ts)`runTeam()` 协调者模式。
- [06 — 本地模型](examples/06-local-model.ts):通过 `baseURL` 把 Ollama 和 Claude 放在同一条管线。 - [06 — 本地模型](examples/06-local-model.ts):通过 `baseURL` 把 Ollama 和 Claude 放在同一条管线。
- [09 — 结构化输出](examples/09-structured-output.ts):任意 agent 产出 Zod 校验过的 JSON。 - [09 — 结构化输出](examples/09-structured-output.ts):任意 agent 产出 Zod 校验过的 JSON。
- [11 — 可观测性](examples/11-trace-observability.ts)`onTrace` 回调,为 LLM 调用、工具、任务发出结构化 span。 - [11 — 可观测性](examples/11-trace-observability.ts)`onTrace` 回调,为 LLM 调用、工具、任务发出结构化 span。
- [with-vercel-ai-sdk](examples/with-vercel-ai-sdk/)Next.js 应用 — OMA `runTeam()` + AI SDK `useChat` 流式输出。
`npx tsx examples/02-team-collaboration.ts` 运行任意一个 `npx tsx examples/02-team-collaboration.ts` 运行脚本示例
## 架构 ## 架构