oRPC AI SDK Integration
Installation
SKILL.md
AI SDK Integration
AI SDK is a free open-source library for building AI-powered products. You can seamlessly integrate it with oRPC without any extra overhead.
Requires AI SDK v5.0.0 or later.
Server
Use streamToEventIterator to convert AI SDK streams to oRPC Event Iterators.
import { os, streamToEventIterator, type } from '@orpc/server'
import { convertToModelMessages, streamText, UIMessage } from 'ai'
import { google } from '@ai-sdk/google'