Migrate AI SDK integration from v5 to v6#382
Merged
mattpocock merged 3 commits intov1from Feb 20, 2026
Merged
Conversation
🦋 Changeset detectedLatest commit: 9ee7e17 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
Task: Foundational vertical slice for AI SDK v5→v6 migration. Key decisions: - Public types use version-agnostic aliases (LanguageModel, EmbeddingModel from "ai") - Internal middleware types use version-specific V3 types from @ai-sdk/provider - Usage shape adapted: inputTokens/outputTokens now objects with .total, totalTokens computed as sum - Middleware specificationVersion: 'v3' added per v6 requirement - Removed obsolete "media" content type check (replaced by "file" in v6) Files changed: - packages/evalite/package.json: ai ^5→^6, @ai-sdk/provider ^2→^3 - packages/evalite/src/ai-sdk.ts: V2→V3 types, LanguageModel public API, usage shape migration - packages/evalite/src/types.ts: LanguageModelV2→LanguageModel, EmbeddingModelV2<string>→EmbeddingModel - packages/evalite-tests/package.json: ai ^5→^6, @ai-sdk/openai ^2→^3 - packages/example/package.json: ai ^5→^6, @ai-sdk/openai ^2→^3, @ai-sdk/provider ^2→^3 - apps/evalite-ui/package.json: ai ^5→^6 - pnpm-lock.yaml: updated Blockers: #380 needs MockLanguageModelV2→V3 migration in test fixtures + scorer generateObject→generateText migration. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…tures to MockLanguageModelV3 (#380) Task: Migrate all v5 API usage to v6 patterns per PRD #378. Key decisions: - Scorers: generateObject() → generateText() + Output.object(), result.object → result.output - Mocks: MockLanguageModelV2 → MockLanguageModelV3 with plain object doGenerate (not function) - Usage shape: V3 nested objects { inputTokens: { total }, outputTokens: { total } } - FinishReason: V3 object shape { unified: "stop", raw: undefined } - Removed obsolete rawCall, providerMetadata, request, response from mock fixtures Files changed: - packages/evalite/src/scorers/utils/statement-evaluation.ts (3 call sites) - packages/evalite/src/scorers/answer-correctness.ts (1 call site) - packages/evalite/src/scorers/answer-relevancy.ts (1 call site) - packages/evalite/src/scorers/context-recall.ts (1 call site) - packages/evalite-tests/tests/fixtures/ai-sdk-traces/traces.eval.ts - packages/evalite-tests/tests/fixtures/ai-sdk-caching/caching.eval.ts - packages/evalite-tests/tests/fixtures/ai-sdk-caching-config-disabled/caching.eval.ts - packages/evalite-tests/tests/fixtures/ai-sdk-caching-config-precedence/caching.eval.ts - packages/example/src/fake-models.eval.ts Blockers: #381 (docs + changeset) is now unblocked. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Task: Update docs to reflect v6 migration per PRD #378. Key decisions: - Type signature: LanguageModelV2 → LanguageModel (version-agnostic alias) - Structured output: generateObject/streamObject → generateText/streamText + Output.object() - tips/vercel-ai-sdk.mdx already v6-compatible, no changes needed - Minor version changeset for evalite package Files changed: - apps/evalite-docs/src/content/docs/api/ai-sdk.mdx - .changeset/0000-ai-sdk-v6.md Blockers: None. All #378 PRD tasks are now complete. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
4e18236 to
9ee7e17
Compare
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.
Summary
ai^6,@ai-sdk/provider^3) and migrate core types (LanguageModelV1→LanguageModel,MockLanguageModelV1→MockLanguageModelV3, etc.)generateObject()togenerateText()+Output.object()pattern for structured outputTest plan
pnpm buildsucceedspnpm --filter evalite-tests testpasses with updated MockLanguageModelV3 fixtures🤖 Generated with Claude Code