feat: add VercelModel adapter for Language Model Specification v3 providers#702
feat: add VercelModel adapter for Language Model Specification v3 providers#702awsarron wants to merge 4 commits intostrands-agents:mainfrom
Conversation
Review SummaryAssessment: Request Changes This is a well-implemented adapter that brings the Vercel AI SDK ecosystem to Strands. The code quality is good, tests are comprehensive (710 lines), and the dependency configuration correctly uses Required Changes1. Documentation PR Required (Blocking)The PR description's "Documentation PR" section shows TODO. Per the review guidelines, new features that add public API surface (like 2. API Review Label MissingThis PR introduces a new public class ( Code Suggestions (Non-blocking)
The implementation follows existing model provider patterns well, and the test coverage is thorough. Looking forward to the documentation PR link! |
🔍 Code Review SummaryAssessment: Request Changes This is a well-implemented adapter that brings the Vercel AI SDK ecosystem to Strands. The code quality is good, tests are comprehensive (710 lines), and the dependency configuration correctly uses ⛔ Required Changes1. Documentation PR Required (Blocking)The PR description's "Documentation PR" section shows TODO. Per review guidelines, new features that add public API surface (like 2. API Review Label SuggestedThis PR introduces a new public class ( 💡 Code Suggestions (Non-blocking)Tool call input handling ( The case 'tool-call':
yield new ModelContentBlockDeltaEvent({
type: 'modelContentBlockDeltaEvent',
delta: {
type: 'toolUseInputDelta',
input: typeof part.input === 'string' ? part.input : JSON.stringify(part.input)
},
})This ensures System prompt type filtering ( Consider using a type guard instead of const isTextBlock = (b: unknown): b is { text: string } =>
typeof b === 'object' && b !== null && 'text' in b && typeof (b as {text?: unknown}).text === 'string'✅ What's Good
Please address the documentation PR requirement and the review is ready to approve! 🚀 |
Updated Review StatusThanks for the updates! The PR description now includes excellent usage examples for both OpenAI and Bedrock backends. 👍 Remaining Blocking ItemThe Documentation PR section still shows TODO. Since Once you've created the documentation PR and linked it, the review is ready to approve! |
21663a4 to
6a7ded4
Compare
Review Check-inI noticed some good updates to the PR: ✅ Cleaner Import Path: The module was renamed from import { VercelModel } from '@strands-agents/sdk/vercel'StatusRemaining Blocking Item: The Documentation PR section still shows TODO. Once the documentation PR is linked, this is ready to approve. The implementation looks solid - comprehensive tests, follows existing patterns, and correct dependency configuration. 👍 |
Description
Adds
VercelModel, an adapter that wraps any Language Model Specification v3 (LanguageModelV3) provider for use as a Strands model provider. This lets users bring models from the Vercel AI SDK ecosystem (e.g.@ai-sdk/amazon-bedrock,@ai-sdk/openai,@ai-sdk/anthropic, etc.) directly into Strands agents.The adapter handles:
tool-input-*and completetool-callevents)LanguageModelV3PromptformatAPICallErrorstatus codes and error message patterns toModelThrottledError,ContextWindowOverflowError, andModelErrorLanguageModelV3CallOptionssettings (temperature, topP, topK, penalties, stop sequences, seed) forwarded through configImportable as a subpath export:
Usage:
OpenAI
Bedrock
@ai-sdk/provideris added as an optional peer dependency since it crosses the API boundary (users constructLanguageModelV3instances and pass them in).Related Issues
#214
#540
Documentation PR
strands-agents/docs#689
Type of Change
New feature
Testing
VercelModelwith both Bedrock and OpenAI backendsHow have you tested the change?
npm run checkChecklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.