docs: ai sdk integration#1685
Closed
dinwwwh wants to merge 1 commit into
Closed
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
More templates
@orpc/arktype
@orpc/bun
@orpc/client
@orpc/cloudflare
@orpc/contract
@orpc/experimental-effect
@orpc/evlog
@orpc/json-schema
@orpc/nest
@orpc/next
@orpc/openapi
@orpc/opentelemetry
@orpc/pino
@orpc/publisher
@orpc/ratelimit
@orpc/server
@orpc/shared
@orpc/tanstack-query
@orpc/valibot
@orpc/zod
commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
| const { messages, sendMessage, status } = useChat({ | ||
| transport: { | ||
| async sendMessages(options) { | ||
| return asyncIteratorToUnproxiedDataStream(await client.chat({ |
Contributor
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
streamToAsyncIteratorObjectandasyncIteratorToUnproxiedDataStream(the v1streamToEventIterator/eventIteratorToUnproxiedDataStreamnames are deprecated aliases in v2)./docs/async-iterator-object) instead of v1's Event Iterator page.implementTool/createToolsections 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'stool()withexecutedelegating tocall(procedure, input, { context }). Those sections can be restored if/when@orpc/ai-sdkis ported.gemini-2.5-flash,import * as z from 'zod'.Notes for review
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.vitepress build— no dead links, page renders.🤖 Generated with Claude Code