Uh oh!
There was an error while loading. Please reload this page.
docs: audit and update Vercel AI SDK comparison - #697
Conversation
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughThis PR refreshes the TanStack AI vs Vercel AI SDK comparison document: revising the feature matrix, clarifying tool/agent abstractions, expanding headless architecture and adapter coverage, updating middleware and media capability details, and refreshing selection guidance and examples. ChangesFeature Matrix and Comparison Clarity
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
🚀 Changeset Version PreviewNo changeset entries found. Merging this PR will not cause a version bump for any packages. |
View your CI Pipeline Execution ↗ for commit 2fe762f
☁️ Nx Cloud last updated this comment at |
@tanstack/ai@tanstack/ai-anthropic@tanstack/ai-client@tanstack/ai-code-mode@tanstack/ai-code-mode-skills@tanstack/ai-devtools-core@tanstack/ai-elevenlabs@tanstack/ai-event-client@tanstack/ai-fal@tanstack/ai-gemini@tanstack/ai-grok@tanstack/ai-groq@tanstack/ai-isolate-cloudflare@tanstack/ai-isolate-node@tanstack/ai-isolate-quickjs@tanstack/ai-ollama@tanstack/ai-openai@tanstack/ai-openrouter@tanstack/ai-preact@tanstack/ai-react@tanstack/ai-react-ui@tanstack/ai-solid@tanstack/ai-solid-ui@tanstack/ai-svelte@tanstack/ai-utils@tanstack/ai-vue@tanstack/ai-vue-ui@tanstack/openai-base@tanstack/preact-ai-devtools@tanstack/react-ai-devtools@tanstack/solid-ai-devtoolscommit: |
2fe762f to
92f1f86CompareThere was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
docs/comparison/vercel-ai-sdk.md (1)
483-502: 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick winAdd the client-side tool execution snippet to this Vercel example.
This section spans server/client behavior but the code only shows server
execute. Add a minimal UI-hook example withonToolCall+addToolResultto match the stated cross-environment flow and keep parity with the TanStack side.Suggested doc patch
**Vercel AI SDK** - Tool objects via the `tool()` helper: @@ const result = await generateText({ model: openai('gpt-5.5'), tools: { getWeather: tool({ description: 'Get current weather for a location', inputSchema: z.object({ city: z.string() }), execute: async ({ city }) => { const data = await weatherApi.get(city) return { temp: data.temperature, condition: data.condition } }, }), }, prompt: "What's the weather in Tokyo?", }) ++// Client-side handling path (when tool has no `execute`)+const { addToolResult } = useChat({+ onToolCall: async ({ toolCall }) => {+ if (toolCall.toolName === 'getWeather') {+ const data = await fetch(`/api/weather?city=${encodeURIComponent(toolCall.args.city)}`).then(r => r.json())+ addToolResult({+ tool: 'getWeather',+ toolCallId: toolCall.toolCallId,+ output: { temp: data.temp, condition: data.condition },+ })+ }+ },+})As per coding guidelines, “Show both server and client sides of the code in documentation when spanning both environments.”
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/comparison/vercel-ai-sdk.md` around lines 483 - 502, Add a minimal client-side snippet next to the server-side tool() example showing how to handle client execution: demonstrate using onToolCall (or the equivalent client hook) to intercept the tool invocation from generateText, call a client-side handler, and then push the result back with addToolResult so the cross-environment flow is complete; reference the existing symbols tool(), generateText, onToolCall, and addToolResult and show it paired with the server execute implementation to maintain parity with the TanStack example.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@docs/comparison/vercel-ai-sdk.md`:
- Around line 483-502: Add a minimal client-side snippet next to the server-side
tool() example showing how to handle client execution: demonstrate using
onToolCall (or the equivalent client hook) to intercept the tool invocation from
generateText, call a client-side handler, and then push the result back with
addToolResult so the cross-environment flow is complete; reference the existing
symbols tool(), generateText, onToolCall, and addToolResult and show it paired
with the server execute implementation to maintain parity with the TanStack
example.
Audited the comparison against current source on both sides. Vercel AI SDK column (was describing ~v4/v5; current is v6): - note the comparison targets ai@6.x (ESM-only) - agent loop: maxSteps -> stopWhen/stepCountIs + the v6 Agent (ToolLoopAgent) class - Solid is supported by both (no longer a TanStack-only differentiator); Angular stays Vercel-only - providers: 50+ direct / 100+ via AI Gateway - MCP client is now stable (@ai-sdk/mcp) - media: generateImage stable, video/speech/transcribe experimental - tool calling: acknowledge client execution via onToolCall/addToolResult - RSC documented as experimental / not the recommended production path - add devToolsMiddleware, wrapEmbeddingModel TanStack AI column (understated / new features): - connection adapters: 6 built-in (incl. XHR for React Native) + fetcher - middleware hooks: onStructuredOutputConfig, onIteration, onToolPhaseComplete; built-ins contentGuardMiddleware and otelMiddleware - per-activity provider coverage: image (+Grok/OpenRouter), TTS (+Grok/fal), transcription (+Grok/ElevenLabs/fal); realtime voice across OpenAI/Grok/ElevenLabs - new: generateAudio, openaiCompatible adapter, structured-output part, client persistence + typed runtime context, headless UI packages, code-mode skills, React Native support; provider-routed mcpTool nuance - refresh image example to gpt-image-2 (1536x1024)
92f1f86 to
b1298eeCompareUh oh!
There was an error while loading. Please reload this page.
What
Audits and updates
docs/comparison/vercel-ai-sdk.md. The page was created in April and only had minor sample touch-ups since, so both columns had drifted. I verified every claim against current source: TanStack facts againstpackages/, and Vercel facts against ai-sdk.dev, the vercel/ai repo, npm, and the v6 blog.Vercel AI SDK column (it was describing ~v4/v5 behavior; current stable is v6)
ai@6.x(v6.0.0, Dec 2025, ESM-only).maxStepsis gone — nowstopWhen+stepCountIs(20)default, plus the v6Agent(ToolLoopAgent) class. Fixed the table row, the strategies section, and the side-by-side snippet (honestly noting the gap is now smaller).@ai-sdk/mcp(createMCPClient).generateImagestable; video/speech/transcribe still experimental.onToolCall+addToolResult; kept the isomorphic.server()/.client()differentiator.devToolsMiddlewareandwrapEmbeddingModel.TanStack AI column (understated / newly shipped features)
fetchertransport.onStructuredOutputConfig,onIteration,onToolPhaseComplete; built-inscontentGuardMiddlewareandotelMiddleware.generateAudio(music/SFX), genericopenaiCompatibleadapter, structured outputs as a typedStructuredOutputPart, client-side persistence + typed runtime context, Code Mode skills, React Native support; provider-routedmcpTool()nuance for MCP.gpt-image-2(1536x1024). Verifiedgpt-5.5/tts-1-hdare valid; did not add embeddings (noembedding()/openaiEmbedexists in current source).Verification
pnpm test:docs→ ✅ no broken links. Docs-only change; no code touched, no changeset needed.Summary by CodeRabbit