This repository was archived by the owner on May 15, 2026. It is now read-only.
Commit ee70707
committed
feat: refactor OpenRouter provider to use Vercel AI SDK
- Replace direct OpenAI SDK usage with @openrouter/ai-sdk-provider
- Add 'ai' package for streamText() and generateText() functions
- Extract reusable AI SDK conversion utilities to src/api/transform/ai-sdk.ts:
- convertToAiSdkMessages(): Anthropic messages to CoreMessage format
- convertToolsForAiSdk(): OpenAI tools to AI SDK tool format
- processAiSdkStreamPart(): AI SDK stream events to ApiStreamChunk
- Update tests to mock AI SDK functions instead of OpenAI client
- Add comprehensive tests for the new ai-sdk.ts utility module
This follows Vercel's AI SDK provider pattern for standardized LLM integration
and enables easier migration of other providers in the future.1 parent 953c777 commit ee70707
6 files changed
Lines changed: 1055 additions & 953 deletions
File tree
- src
- api
- providers
- __tests__
- transform
- __tests__
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments