Skip to content

docs: ai sdk integration#1685

Closed
dinwwwh wants to merge 1 commit into
middleapi:mainfrom
dinwwwh:claude/orpc-v2-ai-sdk-docs-359fdb
Closed

docs: ai sdk integration#1685
dinwwwh wants to merge 1 commit into
middleapi:mainfrom
dinwwwh:claude/orpc-v2-ai-sdk-docs-359fdb

Conversation

@dinwwwh

@dinwwwh dinwwwh commented Jul 18, 2026

Copy link
Copy Markdown
Member

What

Ports the AI SDK integration page from the v1 docs to v2 and adds it to the Integrations sidebar.

Changes from the v1 page

  • Uses the v2 helper names: streamToAsyncIteratorObject and asyncIteratorToUnproxiedDataStream (the v1 streamToEventIterator/eventIteratorToUnproxiedDataStream names are deprecated aliases in v2).
  • Links point to the renamed AsyncIteratorObject docs (/docs/async-iterator-object) instead of v1's Event Iterator page.
  • The v1 implementTool/createTool sections relied on @orpc/ai-sdk, which has not been ported to v2. They are replaced with a "Tool Calling" section showing the v2-native approach: AI SDK's tool() with execute delegating to call(procedure, input, { context }). Those sections can be restored if/when @orpc/ai-sdk is ported.
  • Minor freshening: gemini-2.5-flash, import * as z from 'zod'.

Notes for review

  • Code blocks are plain (not twoslash) to avoid adding ai, @ai-sdk/google, @ai-sdk/react, and React to the content app's devDependencies. Happy to convert to twoslash if adding those deps is preferred.
  • Verified with a full vitepress build — no dead links, page renders.

🤖 Generated with Claude Code

Port the AI SDK integration page from v1 to v2: use the renamed
streamToAsyncIteratorObject/asyncIteratorToUnproxiedDataStream helpers,
link to the AsyncIteratorObject docs, and replace the @orpc/ai-sdk tool
helper sections (package not ported to v2) with a manual Tool Calling
example using AI SDK's tool() + call().

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
orpc Ready Ready Preview, Comment Jul 18, 2026 12:41pm

@pkg-pr-new

pkg-pr-new Bot commented Jul 18, 2026

Copy link
Copy Markdown
More templates

@orpc/arktype

npm i https://pkg.pr.new/@orpc/arktype@1685

@orpc/bun

npm i https://pkg.pr.new/@orpc/bun@1685

@orpc/client

npm i https://pkg.pr.new/@orpc/client@1685

@orpc/cloudflare

npm i https://pkg.pr.new/@orpc/cloudflare@1685

@orpc/contract

npm i https://pkg.pr.new/@orpc/contract@1685

@orpc/experimental-effect

npm i https://pkg.pr.new/@orpc/experimental-effect@1685

@orpc/evlog

npm i https://pkg.pr.new/@orpc/evlog@1685

@orpc/json-schema

npm i https://pkg.pr.new/@orpc/json-schema@1685

@orpc/nest

npm i https://pkg.pr.new/@orpc/nest@1685

@orpc/next

npm i https://pkg.pr.new/@orpc/next@1685

@orpc/openapi

npm i https://pkg.pr.new/@orpc/openapi@1685

@orpc/opentelemetry

npm i https://pkg.pr.new/@orpc/opentelemetry@1685

@orpc/pino

npm i https://pkg.pr.new/@orpc/pino@1685

@orpc/publisher

npm i https://pkg.pr.new/@orpc/publisher@1685

@orpc/ratelimit

npm i https://pkg.pr.new/@orpc/ratelimit@1685

@orpc/server

npm i https://pkg.pr.new/@orpc/server@1685

@orpc/shared

npm i https://pkg.pr.new/@orpc/shared@1685

@orpc/tanstack-query

npm i https://pkg.pr.new/@orpc/tanstack-query@1685

@orpc/valibot

npm i https://pkg.pr.new/@orpc/valibot@1685

@orpc/zod

npm i https://pkg.pr.new/@orpc/zod@1685

commit: ca96fd5

@codecov

codecov Bot commented Jul 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@codspeed-hq

codspeed-hq Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 18 untouched benchmarks


Comparing dinwwwh:claude/orpc-v2-ai-sdk-docs-359fdb (ca96fd5) with main (61ef170)

Open in CodSpeed

Comment thread apps/content/docs/integrations/ai-sdk.md
const { messages, sendMessage, status } = useChat({
transport: {
async sendMessages(options) {
return asyncIteratorToUnproxiedDataStream(await client.chat({

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The client is undefined in this snippet. Consider adding a short setup note (e.g. const client = createORPCClient(link)) so readers know where client.chat comes from.

@dinwwwh dinwwwh closed this Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant