docs(ai-agents): add chat.agent guide and refresh the AI agent guides - #4524
docs(ai-agents): add chat.agent guide and refresh the AI agent guides#4524D-K-P wants to merge 3 commits into
Conversation
Adds a "Build a customer support chat agent" guide to the AI agents section, surfaces the ClickHouse chat agent example in the guides index and the AI agents overview, and refreshes the five existing workflow guides so their code is current. The pattern guides (prompt chaining, routing, parallelization, orchestrator, evaluator-optimizer) still used retired models and dated APIs. Updated them to current Anthropic Claude models (claude-haiku-4-5 for lightweight classifier roles, claude-sonnet-4-5 for the main work) and modernized the code: - route-question uses generateObject for the routing decision instead of generateText plus manual JSON parsing. - verify-news-article uses ModelMessage in place of the renamed CoreMessage. - Fixed translate-and-refine discarding its recursive refinement result, so refined translations never returned to the caller. - Fixed an invalid JSON test payload in generate-translate-copy. The pattern concepts are unchanged; only the example code was stale.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📜 Recent review details🧰 Additional context used📓 Path-based instructions (1)docs/**/*.mdx📄 CodeRabbit inference engine (docs/CLAUDE.md)
Files:
🧠 Learnings (2)📚 Learning: 2026-03-10T12:44:14.176ZApplied to files:
📚 Learning: 2026-04-30T20:30:29.458ZApplied to files:
🔇 Additional comments (5)
WalkthroughAdded documentation for durable, multi-turn chat agents with streaming, tools, session startup, and access tokens. Added chat agent entries to documentation navigation and project lists. Updated AI agent examples to use Anthropic models. Replaced manual routing parsing with typed classification and fixed recursive refinement result propagation. Corrected an example payload to valid JSON. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Describe the chat agent lifecycle as a durable session rather than a single run, add an authorization note to the token-minting example, switch the guide code fences to the typescript language tag, and enable telemetry on the news verifier's claim-extraction call so it matches the guide's description.
Pass tools into chat.toStreamTextOptions({ tools }) in the chat agent guide so
HITL approval detection and auto-injected skill tools survive, instead of
passing them straight to streamText where the merged set is dropped. Give the
recursive translate-and-refine task an explicit return type so the copied
snippet doesn't hit TypeScript's circular-inference error.
Summary
Adds a "Build a chat agent" guide to the AI agents section, surfaces the
ClickHouse chat agent example in the guides index and the AI agents overview,
and refreshes the five existing workflow guides so their code is current.
Details
The pattern guides (prompt chaining, routing, parallelization, orchestrator,
evaluator-optimizer) still used retired models and dated APIs. Updated them to
current Anthropic Claude models (claude-haiku-4-5 for lightweight classifier
roles, claude-sonnet-4-5 for the main work) and modernized the code:
generateText plus manual JSON parsing.
refined translations never returned to the caller.
The pattern concepts are unchanged; only the example code was stale.