backport v6#5
Open
callycodes wants to merge 2524 commits into
Open
Conversation
## Background the change in #14102 didn't pull from latest main and didn't account for the latest vertex/xai package created. and thus `main` on that path was using the wrong import ## Summary use correct import
…it's fixed (#14873) ## Background follow up to #14863 - missed removing the exclusion, related to #14859 ## Checklist <!-- Do not edit this list. Leave items unchecked that don't apply. If you need to track subtasks, create a new "## Tasks" section Please check if the PR fulfills the following requirements: --> - [x] All commits are signed (PRs with unsigned commits cannot be merged) - [ ] Tests have been added / updated (for bug fixes / features) - [ ] Documentation has been added / updated (for bug fixes / features) - [ ] A _patch_ changeset for relevant packages has been added (for bug fixes / features - run `pnpm changeset` in the project root) - [x] I have reviewed this pull request (self-review)
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ `main` is currently in **pre mode** so this branch has prereleases rather than normal releases. If you want to exit prereleases, run `changeset pre exit` on `main`.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ # Releases ## @ai-sdk/google-vertex@5.0.0-beta.66 ### Patch Changes - 1f4058f: fix(vertex): use correct import for token generator Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Switches the pre-release npm tag from `beta` to `canary`. Major/minor/patch versions are preserved, and the increment counter is carried over (e.g. `7.0.0-beta.116` → `7.0.0-canary.116`). The next changeset bump produces `7.0.0-canary.117`. Modeled on the previous switch from `canary` → `alpha` in [ec517bb](ec517bb) ([#6355](#6355)). Two intentional deviations from that PR: - That PR reset the increment to `.0`; this one preserves it so canary picks up where beta left off. - That PR also refreshed `initialVersions` in `pre.json`; this one leaves it untouched. `initialVersions` is informational — the next-version computation reads from current `package.json`, not from this field, so leaving it stale has no effect on the release plan.
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ `main` is currently in **pre mode** so this branch has prereleases rather than normal releases. If you want to exit prereleases, run `changeset pre exit` on `main`.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ # Releases ## ai@7.0.0-canary.117 ### Patch Changes - 0c4c275: trigger initial canary release - Updated dependencies [0c4c275] - @ai-sdk/provider-utils@5.0.0-canary.31 - @ai-sdk/provider@4.0.0-canary.15 - @ai-sdk/gateway@4.0.0-canary.68 ## @ai-sdk/alibaba@2.0.0-canary.39 ### Patch Changes - 0c4c275: trigger initial canary release - Updated dependencies [0c4c275] - @ai-sdk/openai-compatible@3.0.0-canary.37 - @ai-sdk/provider-utils@5.0.0-canary.31 - @ai-sdk/provider@4.0.0-canary.15 ## @ai-sdk/amazon-bedrock@5.0.0-canary.48 ### Patch Changes - 0c4c275: trigger initial canary release - Updated dependencies [0c4c275] - @ai-sdk/provider-utils@5.0.0-canary.31 - @ai-sdk/anthropic@4.0.0-canary.43 - @ai-sdk/provider@4.0.0-canary.15 ## @ai-sdk/angular@3.0.0-canary.117 ### Patch Changes - 0c4c275: trigger initial canary release - Updated dependencies [0c4c275] - @ai-sdk/provider-utils@5.0.0-canary.31 - ai@7.0.0-canary.117 ## @ai-sdk/anthropic@4.0.0-canary.43 ### Patch Changes - 0c4c275: trigger initial canary release - Updated dependencies [0c4c275] - @ai-sdk/provider-utils@5.0.0-canary.31 - @ai-sdk/provider@4.0.0-canary.15 ## @ai-sdk/assemblyai@3.0.0-canary.33 ### Patch Changes - 0c4c275: trigger initial canary release - Updated dependencies [0c4c275] - @ai-sdk/provider-utils@5.0.0-canary.31 - @ai-sdk/provider@4.0.0-canary.15 ## @ai-sdk/azure@4.0.0-canary.45 ### Patch Changes - 0c4c275: trigger initial canary release - Updated dependencies [0c4c275] - @ai-sdk/provider-utils@5.0.0-canary.31 - @ai-sdk/provider@4.0.0-canary.15 - @ai-sdk/openai@4.0.0-canary.45 ## @ai-sdk/baseten@2.0.0-canary.37 ### Patch Changes - 0c4c275: trigger initial canary release - Updated dependencies [0c4c275] - @ai-sdk/openai-compatible@3.0.0-canary.37 - @ai-sdk/provider-utils@5.0.0-canary.31 - @ai-sdk/provider@4.0.0-canary.15 ## @ai-sdk/black-forest-labs@2.0.0-canary.32 ### Patch Changes - 0c4c275: trigger initial canary release - Updated dependencies [0c4c275] - @ai-sdk/provider-utils@5.0.0-canary.31 - @ai-sdk/provider@4.0.0-canary.15 ## @ai-sdk/bytedance@2.0.0-canary.33 ### Patch Changes - 0c4c275: trigger initial canary release - Updated dependencies [0c4c275] - @ai-sdk/provider-utils@5.0.0-canary.31 - @ai-sdk/provider@4.0.0-canary.15 ## @ai-sdk/cerebras@3.0.0-canary.37 ### Patch Changes - 0c4c275: trigger initial canary release - Updated dependencies [0c4c275] - @ai-sdk/openai-compatible@3.0.0-canary.37 - @ai-sdk/provider-utils@5.0.0-canary.31 - @ai-sdk/provider@4.0.0-canary.15 ## @ai-sdk/codemod@4.0.0-canary.5 ### Patch Changes - 0c4c275: trigger initial canary release ## @ai-sdk/cohere@4.0.0-canary.33 ### Patch Changes - 0c4c275: trigger initial canary release - Updated dependencies [0c4c275] - @ai-sdk/provider-utils@5.0.0-canary.31 - @ai-sdk/provider@4.0.0-canary.15 ## @ai-sdk/deepgram@3.0.0-canary.32 ### Patch Changes - 0c4c275: trigger initial canary release - Updated dependencies [0c4c275] - @ai-sdk/provider-utils@5.0.0-canary.31 - @ai-sdk/provider@4.0.0-canary.15 ## @ai-sdk/deepinfra@3.0.0-canary.37 ### Patch Changes - 0c4c275: trigger initial canary release - Updated dependencies [0c4c275] - @ai-sdk/openai-compatible@3.0.0-canary.37 - @ai-sdk/provider-utils@5.0.0-canary.31 - @ai-sdk/provider@4.0.0-canary.15 ## @ai-sdk/deepseek@3.0.0-canary.34 ### Patch Changes - 0c4c275: trigger initial canary release - Updated dependencies [0c4c275] - @ai-sdk/provider-utils@5.0.0-canary.31 - @ai-sdk/provider@4.0.0-canary.15 ## @ai-sdk/devtools@1.0.0-canary.20 ### Patch Changes - 0c4c275: trigger initial canary release - Updated dependencies [0c4c275] - @ai-sdk/provider@4.0.0-canary.15 ## @ai-sdk/elevenlabs@3.0.0-canary.32 ### Patch Changes - 0c4c275: trigger initial canary release - Updated dependencies [0c4c275] - @ai-sdk/provider-utils@5.0.0-canary.31 - @ai-sdk/provider@4.0.0-canary.15 ## @ai-sdk/fal@3.0.0-canary.32 ### Patch Changes - 0c4c275: trigger initial canary release - Updated dependencies [0c4c275] - @ai-sdk/provider-utils@5.0.0-canary.31 - @ai-sdk/provider@4.0.0-canary.15 ## @ai-sdk/fireworks@3.0.0-canary.37 ### Patch Changes - 0c4c275: trigger initial canary release - Updated dependencies [0c4c275] - @ai-sdk/openai-compatible@3.0.0-canary.37 - @ai-sdk/provider-utils@5.0.0-canary.31 - @ai-sdk/provider@4.0.0-canary.15 ## @ai-sdk/gateway@4.0.0-canary.68 ### Patch Changes - 0c4c275: trigger initial canary release - Updated dependencies [0c4c275] - @ai-sdk/provider-utils@5.0.0-canary.31 - @ai-sdk/provider@4.0.0-canary.15 ## @ai-sdk/gladia@3.0.0-canary.32 ### Patch Changes - 0c4c275: trigger initial canary release - Updated dependencies [0c4c275] - @ai-sdk/provider-utils@5.0.0-canary.31 - @ai-sdk/provider@4.0.0-canary.15 ## @ai-sdk/google@4.0.0-canary.50 ### Patch Changes - 0c4c275: trigger initial canary release - Updated dependencies [0c4c275] - @ai-sdk/provider-utils@5.0.0-canary.31 - @ai-sdk/provider@4.0.0-canary.15 ## @ai-sdk/google-vertex@5.0.0-canary.67 ### Patch Changes - 0c4c275: trigger initial canary release - Updated dependencies [0c4c275] - @ai-sdk/openai-compatible@3.0.0-canary.37 - @ai-sdk/provider-utils@5.0.0-canary.31 - @ai-sdk/anthropic@4.0.0-canary.43 - @ai-sdk/provider@4.0.0-canary.15 - @ai-sdk/google@4.0.0-canary.50 ## @ai-sdk/groq@4.0.0-canary.35 ### Patch Changes - 0c4c275: trigger initial canary release - Updated dependencies [0c4c275] - @ai-sdk/provider-utils@5.0.0-canary.31 - @ai-sdk/provider@4.0.0-canary.15 ## @ai-sdk/huggingface@2.0.0-canary.37 ### Patch Changes - 0c4c275: trigger initial canary release - Updated dependencies [0c4c275] - @ai-sdk/openai-compatible@3.0.0-canary.37 - @ai-sdk/provider-utils@5.0.0-canary.31 - @ai-sdk/provider@4.0.0-canary.15 ## @ai-sdk/hume@3.0.0-canary.32 ### Patch Changes - 0c4c275: trigger initial canary release - Updated dependencies [0c4c275] - @ai-sdk/provider-utils@5.0.0-canary.31 - @ai-sdk/provider@4.0.0-canary.15 ## @ai-sdk/klingai@4.0.0-canary.33 ### Patch Changes - 0c4c275: trigger initial canary release - Updated dependencies [0c4c275] - @ai-sdk/provider-utils@5.0.0-canary.31 - @ai-sdk/provider@4.0.0-canary.15 ## @ai-sdk/langchain@3.0.0-canary.117 ### Patch Changes - 0c4c275: trigger initial canary release - Updated dependencies [0c4c275] - ai@7.0.0-canary.117 ## @ai-sdk/llamaindex@3.0.0-canary.117 ### Patch Changes - 0c4c275: trigger initial canary release - Updated dependencies [0c4c275] - ai@7.0.0-canary.117 ## @ai-sdk/lmnt@3.0.0-canary.32 ### Patch Changes - 0c4c275: trigger initial canary release - Updated dependencies [0c4c275] - @ai-sdk/provider-utils@5.0.0-canary.31 - @ai-sdk/provider@4.0.0-canary.15 ## @ai-sdk/luma@3.0.0-canary.32 ### Patch Changes - 0c4c275: trigger initial canary release - Updated dependencies [0c4c275] - @ai-sdk/provider-utils@5.0.0-canary.31 - @ai-sdk/provider@4.0.0-canary.15 ## @ai-sdk/mcp@2.0.0-canary.38 ### Patch Changes - 0c4c275: trigger initial canary release - Updated dependencies [0c4c275] - @ai-sdk/provider-utils@5.0.0-canary.31 - @ai-sdk/provider@4.0.0-canary.15 ## @ai-sdk/mistral@4.0.0-canary.34 ### Patch Changes - 0c4c275: trigger initial canary release - Updated dependencies [0c4c275] - @ai-sdk/provider-utils@5.0.0-canary.31 - @ai-sdk/provider@4.0.0-canary.15 ## @ai-sdk/moonshotai@3.0.0-canary.37 ### Patch Changes - 0c4c275: trigger initial canary release - Updated dependencies [0c4c275] - @ai-sdk/openai-compatible@3.0.0-canary.37 - @ai-sdk/provider-utils@5.0.0-canary.31 - @ai-sdk/provider@4.0.0-canary.15 ## @ai-sdk/open-responses@2.0.0-canary.34 ### Patch Changes - 0c4c275: trigger initial canary release - Updated dependencies [0c4c275] - @ai-sdk/provider-utils@5.0.0-canary.31 - @ai-sdk/provider@4.0.0-canary.15 ## @ai-sdk/openai@4.0.0-canary.45 ### Patch Changes - 0c4c275: trigger initial canary release - Updated dependencies [0c4c275] - @ai-sdk/provider-utils@5.0.0-canary.31 - @ai-sdk/provider@4.0.0-canary.15 ## @ai-sdk/openai-compatible@3.0.0-canary.37 ### Patch Changes - 0c4c275: trigger initial canary release - Updated dependencies [0c4c275] - @ai-sdk/provider-utils@5.0.0-canary.31 - @ai-sdk/provider@4.0.0-canary.15 ## @ai-sdk/otel@1.0.0-canary.63 ### Patch Changes - 0c4c275: trigger initial canary release - Updated dependencies [0c4c275] - @ai-sdk/provider@4.0.0-canary.15 - ai@7.0.0-canary.117 ## @ai-sdk/perplexity@4.0.0-canary.35 ### Patch Changes - 0c4c275: trigger initial canary release - Updated dependencies [0c4c275] - @ai-sdk/provider-utils@5.0.0-canary.31 - @ai-sdk/provider@4.0.0-canary.15 ## @ai-sdk/prodia@2.0.0-canary.35 ### Patch Changes - 0c4c275: trigger initial canary release - Updated dependencies [0c4c275] - @ai-sdk/provider-utils@5.0.0-canary.31 - @ai-sdk/provider@4.0.0-canary.15 ## @ai-sdk/provider@4.0.0-canary.15 ### Patch Changes - 0c4c275: trigger initial canary release ## @ai-sdk/provider-utils@5.0.0-canary.31 ### Patch Changes - 0c4c275: trigger initial canary release - Updated dependencies [0c4c275] - @ai-sdk/provider@4.0.0-canary.15 ## @ai-sdk/react@4.0.0-canary.117 ### Patch Changes - 0c4c275: trigger initial canary release - Updated dependencies [0c4c275] - @ai-sdk/provider-utils@5.0.0-canary.31 - ai@7.0.0-canary.117 ## @ai-sdk/replicate@3.0.0-canary.33 ### Patch Changes - 0c4c275: trigger initial canary release - Updated dependencies [0c4c275] - @ai-sdk/provider-utils@5.0.0-canary.31 - @ai-sdk/provider@4.0.0-canary.15 ## @ai-sdk/revai@3.0.0-canary.33 ### Patch Changes - 0c4c275: trigger initial canary release - Updated dependencies [0c4c275] - @ai-sdk/provider-utils@5.0.0-canary.31 - @ai-sdk/provider@4.0.0-canary.15 ## @ai-sdk/rsc@3.0.0-canary.118 ### Patch Changes - 0c4c275: trigger initial canary release - Updated dependencies [0c4c275] - @ai-sdk/provider-utils@5.0.0-canary.31 - @ai-sdk/provider@4.0.0-canary.15 - ai@7.0.0-canary.117 ## @ai-sdk/svelte@5.0.0-canary.117 ### Patch Changes - 0c4c275: trigger initial canary release - Updated dependencies [0c4c275] - @ai-sdk/provider-utils@5.0.0-canary.31 - ai@7.0.0-canary.117 ## @ai-sdk/test-server@2.0.0-canary.4 ### Patch Changes - 0c4c275: trigger initial canary release ## @ai-sdk/togetherai@3.0.0-canary.37 ### Patch Changes - 0c4c275: trigger initial canary release - Updated dependencies [0c4c275] - @ai-sdk/openai-compatible@3.0.0-canary.37 - @ai-sdk/provider-utils@5.0.0-canary.31 - @ai-sdk/provider@4.0.0-canary.15 ## @ai-sdk/valibot@3.0.0-canary.31 ### Patch Changes - 0c4c275: trigger initial canary release - Updated dependencies [0c4c275] - @ai-sdk/provider-utils@5.0.0-canary.31 ## @ai-sdk/vercel@3.0.0-canary.37 ### Patch Changes - 0c4c275: trigger initial canary release - Updated dependencies [0c4c275] - @ai-sdk/openai-compatible@3.0.0-canary.37 - @ai-sdk/provider-utils@5.0.0-canary.31 - @ai-sdk/provider@4.0.0-canary.15 ## @ai-sdk/voyage@1.0.0-canary.5 ### Patch Changes - 0c4c275: trigger initial canary release - Updated dependencies [0c4c275] - @ai-sdk/provider-utils@5.0.0-canary.31 - @ai-sdk/provider@4.0.0-canary.15 ## @ai-sdk/vue@4.0.0-canary.117 ### Patch Changes - 0c4c275: trigger initial canary release - Updated dependencies [0c4c275] - @ai-sdk/provider-utils@5.0.0-canary.31 - ai@7.0.0-canary.117 ## @ai-sdk/workflow@1.0.0-canary.32 ### Patch Changes - 0c4c275: trigger initial canary release - Updated dependencies [0c4c275] - @ai-sdk/provider-utils@5.0.0-canary.31 - @ai-sdk/provider@4.0.0-canary.15 - ai@7.0.0-canary.117 ## @ai-sdk/xai@4.0.0-canary.50 ### Patch Changes - 0c4c275: trigger initial canary release - Updated dependencies [0c4c275] - @ai-sdk/openai-compatible@3.0.0-canary.37 - @ai-sdk/provider-utils@5.0.0-canary.31 - @ai-sdk/provider@4.0.0-canary.15 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…4889) ## Summary - Mistral's API returns cached token counts via `num_cached_tokens`, `prompt_tokens_details.cached_tokens`, and `prompt_token_details.cached_tokens` - These fields were not included in `mistralUsageSchema` (stripped by Zod) and not mapped in `convertMistralUsage` - All prompt tokens were incorrectly reported as `noCacheTokens` - Adds the fields to the schema and computes `cacheRead`/`noCache` correctly ## Test plan - [x] Unit test with cached token fields in usage response - [x] Verify noCache = promptTokens - cacheReadTokens - [x] Verify cacheRead is populated when cached tokens present - [x] Verify backward compatibility when cached fields are absent ## Related Issues Closes #14382 Supersedes #14419 Co-authored-by: Lars Grammel <lars.grammel@gmail.com>
## Summary Improve JSDoc and documentation for the different types of tools. ## Related Issues Follow-up from #14849
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ `main` is currently in **pre mode** so this branch has prereleases rather than normal releases. If you want to exit prereleases, run `changeset pre exit` on `main`.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ # Releases ## @ai-sdk/mistral@4.0.0-canary.35 ### Patch Changes - 8abd80f: Map cached token counts from Mistral API usage response. Previously all prompt tokens were reported as noCacheTokens, ignoring the `num_cached_tokens`, `prompt_tokens_details.cached_tokens`, and `prompt_token_details.cached_tokens` fields returned by Mistral. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
## Summary
When `timeout: { stepMs }` or `timeout: { chunkMs }` fires, the SDK
calls `stepAbortController.abort()` / `chunkAbortController.abort()`
with no argument. The resulting `signal.reason` is a generic
`AbortError` DOMException indistinguishable from a user-initiated
`controller.abort()`.
This PR passes a `TimeoutError` DOMException as the abort reason,
mirroring what `AbortSignal.timeout()` produces natively (and what
`totalMs` already does, since it goes through `mergeAbortSignals` →
`AbortSignal.timeout(n)`).
## Motivation
Consumers currently can't tell apart "user pressed cancel" from
"framework step/chunk timeout fired". Both surface as `AbortError`.
Tagging the reason makes them distinguishable via `signal.reason.name
=== 'TimeoutError'`.
This also brings step/chunk timeouts into symmetry with `totalMs` and
user-supplied `AbortSignal.timeout()`, which already produce
`TimeoutError`.
#14860) ## Background Cohere's chat API accepts image inputs (data URIs and HTTPS URLs) on vision-capable models like `command-a-vision-07-2025`, but the `cohere` provider didn't expose this. Today, every `file` part on a user message is funneled into the `documents` array (RAG), so an image either gets sent as garbled bytes-as-text or hits the `url` branch and throws. ## Summary - Image `file` parts on user messages are now emitted as `image_url` content parts; non-image files keep going to `documents` (RAG behavior unchanged). - `command-a-vision-07-2025` added to the model union; `supportedUrls` set to `image/*` so HTTPS image URLs pass through without pre-download. - New per-image-part option `providerOptions.cohere.detail` (`'auto' | 'low' | 'high'`) maps to `image_url.detail`. ## Manual Verification New examples were added to verify. ## Checklist - [x] All commits are signed (PRs with unsigned commits cannot be merged) - [x] Tests have been added / updated (for bug fixes / features) - [x] Documentation has been added / updated (for bug fixes / features) - [x] A _patch_ changeset for relevant packages has been added (for bug fixes / features - run `pnpm changeset` in the project root) - [x] I have reviewed this pull request (self-review) ## Future Work N/A ## Related Issues N/A
…messages with tool calls (#14950) ## background #13744 changed `content: text` to `content: text || null` for assistant messages. this correctly fixed tool-only messages (openai requires `content: null` when `tool_calls` is present), but also broke the case where an assistant message has empty text and no tool calls - openai rejects `content: null` when `tool_calls` is absent with "Invalid value for 'content': expected a string, got null" per the [openai api spec](https://developers.openai.com/api/reference/go/resources/chat/subresources/completions), content is "required unless `tool_calls` or `function_call` is specified" ## summary - only send `null` when `toolCalls.length > 0`, otherwise preserve the text string - add regression tests for both `@ai-sdk/openai` and `@ai-sdk/openai-compatible` ## verification verified against live openai chat completions api with `openai.chat('gpt-4o-mini')` - empty assistant content now sends `content: ""` and returns a valid response ## related issues follow-up to #13744
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ `main` is currently in **pre mode** so this branch has prereleases rather than normal releases. If you want to exit prereleases, run `changeset pre exit` on `main`.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ # Releases ## ai@7.0.0-canary.118 ### Patch Changes - 47e65d6: fix(ai): tag step/chunk timeout aborts with `TimeoutError` reason When `timeout: { stepMs }` or `timeout: { chunkMs }` fires, the abort reason is now a `TimeoutError` `DOMException`, matching what `AbortSignal.timeout()` produces natively. Consumers can distinguish a framework timeout from a user-initiated cancel via `signal.reason.name === 'TimeoutError'`. ## @ai-sdk/alibaba@2.0.0-canary.40 ### Patch Changes - Updated dependencies [cd9c311] - @ai-sdk/openai-compatible@3.0.0-canary.38 ## @ai-sdk/angular@3.0.0-canary.118 ### Patch Changes - Updated dependencies [47e65d6] - ai@7.0.0-canary.118 ## @ai-sdk/azure@4.0.0-canary.46 ### Patch Changes - Updated dependencies [cd9c311] - @ai-sdk/openai@4.0.0-canary.46 ## @ai-sdk/baseten@2.0.0-canary.38 ### Patch Changes - Updated dependencies [cd9c311] - @ai-sdk/openai-compatible@3.0.0-canary.38 ## @ai-sdk/cerebras@3.0.0-canary.38 ### Patch Changes - Updated dependencies [cd9c311] - @ai-sdk/openai-compatible@3.0.0-canary.38 ## @ai-sdk/cohere@4.0.0-canary.34 ### Patch Changes - f2919d5: feat(provider/cohere): add support for passing images to Cohere models ## @ai-sdk/deepinfra@3.0.0-canary.38 ### Patch Changes - Updated dependencies [cd9c311] - @ai-sdk/openai-compatible@3.0.0-canary.38 ## @ai-sdk/fireworks@3.0.0-canary.38 ### Patch Changes - Updated dependencies [cd9c311] - @ai-sdk/openai-compatible@3.0.0-canary.38 ## @ai-sdk/google-vertex@5.0.0-canary.68 ### Patch Changes - Updated dependencies [cd9c311] - @ai-sdk/openai-compatible@3.0.0-canary.38 ## @ai-sdk/huggingface@2.0.0-canary.38 ### Patch Changes - Updated dependencies [cd9c311] - @ai-sdk/openai-compatible@3.0.0-canary.38 ## @ai-sdk/langchain@3.0.0-canary.118 ### Patch Changes - Updated dependencies [47e65d6] - ai@7.0.0-canary.118 ## @ai-sdk/llamaindex@3.0.0-canary.118 ### Patch Changes - Updated dependencies [47e65d6] - ai@7.0.0-canary.118 ## @ai-sdk/moonshotai@3.0.0-canary.38 ### Patch Changes - Updated dependencies [cd9c311] - @ai-sdk/openai-compatible@3.0.0-canary.38 ## @ai-sdk/openai@4.0.0-canary.46 ### Patch Changes - cd9c311: fix(openai, openai-compatible): only send null content for assistant messages with tool calls ## @ai-sdk/openai-compatible@3.0.0-canary.38 ### Patch Changes - cd9c311: fix(openai, openai-compatible): only send null content for assistant messages with tool calls ## @ai-sdk/otel@1.0.0-canary.64 ### Patch Changes - Updated dependencies [47e65d6] - ai@7.0.0-canary.118 ## @ai-sdk/react@4.0.0-canary.118 ### Patch Changes - Updated dependencies [47e65d6] - ai@7.0.0-canary.118 ## @ai-sdk/rsc@3.0.0-canary.119 ### Patch Changes - Updated dependencies [47e65d6] - ai@7.0.0-canary.118 ## @ai-sdk/svelte@5.0.0-canary.118 ### Patch Changes - Updated dependencies [47e65d6] - ai@7.0.0-canary.118 ## @ai-sdk/togetherai@3.0.0-canary.38 ### Patch Changes - Updated dependencies [cd9c311] - @ai-sdk/openai-compatible@3.0.0-canary.38 ## @ai-sdk/vercel@3.0.0-canary.38 ### Patch Changes - Updated dependencies [cd9c311] - @ai-sdk/openai-compatible@3.0.0-canary.38 ## @ai-sdk/vue@4.0.0-canary.118 ### Patch Changes - Updated dependencies [47e65d6] - ai@7.0.0-canary.118 ## @ai-sdk/workflow@1.0.0-canary.33 ### Patch Changes - Updated dependencies [47e65d6] - ai@7.0.0-canary.118 ## @ai-sdk/xai@4.0.0-canary.51 ### Patch Changes - Updated dependencies [cd9c311] - @ai-sdk/openai-compatible@3.0.0-canary.38 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
## Background Mistral just released Mistral Medium 3.5. See https://docs.mistral.ai/models/model-cards/mistral-medium-3-5-26-04 ## Summary Adds `mistral-medium-3.5` to the modelid type, and adds it to the list of models that supports reasoning effort. Adds the model to documentation. ## Manual Verification I tried a modified version of the Mistral text and stream examples (with the model id swapped out for `mistral-medium-3.5`). I also tried the reasoning effort example with the model id swapped out. Both work as expected. ## Checklist - [X] All commits are signed (PRs with unsigned commits cannot be merged) - [ ] Tests have been added / updated (for bug fixes / features) - [X] Documentation has been added / updated (for bug fixes / features) - [X] A _patch_ changeset for relevant packages has been added (for bug fixes / features - run `pnpm changeset` in the project root) - [X] I have reviewed this pull request (self-review) ## Future Work I left the image support *crossed out*, since this is also the case for e.g. `mistral-small-latest`, and I haven't tested this. Maybe both should be updated when tested. --------- Co-authored-by: Lars Grammel <lars.grammel@gmail.com>
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ `main` is currently in **pre mode** so this branch has prereleases rather than normal releases. If you want to exit prereleases, run `changeset pre exit` on `main`.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ # Releases ## ai@7.0.0-canary.119 ### Patch Changes - Updated dependencies [8e53eb7] - @ai-sdk/gateway@4.0.0-canary.69 ## @ai-sdk/angular@3.0.0-canary.119 ### Patch Changes - ai@7.0.0-canary.119 ## @ai-sdk/gateway@4.0.0-canary.69 ### Patch Changes - 8e53eb7: chore(provider/gateway): update gateway model settings files ## @ai-sdk/langchain@3.0.0-canary.119 ### Patch Changes - ai@7.0.0-canary.119 ## @ai-sdk/llamaindex@3.0.0-canary.119 ### Patch Changes - ai@7.0.0-canary.119 ## @ai-sdk/mistral@4.0.0-canary.36 ### Patch Changes - 3ae1d12: Add support for mistral-medium-3.5 ## @ai-sdk/otel@1.0.0-canary.65 ### Patch Changes - ai@7.0.0-canary.119 ## @ai-sdk/react@4.0.0-canary.119 ### Patch Changes - ai@7.0.0-canary.119 ## @ai-sdk/rsc@3.0.0-canary.120 ### Patch Changes - ai@7.0.0-canary.119 ## @ai-sdk/svelte@5.0.0-canary.119 ### Patch Changes - ai@7.0.0-canary.119 ## @ai-sdk/vue@4.0.0-canary.119 ### Patch Changes - ai@7.0.0-canary.119 ## @ai-sdk/workflow@1.0.0-canary.34 ### Patch Changes - ai@7.0.0-canary.119 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
… top-level message file part types (#14921) ## Background In #14733, we unified the different ways to pass file content for top-level `type: 'file'` parts. However, for tool result output content parts, the AI SDK has been still using various independent shapes like `file-*`, and `image-*`, the latter of which were already deprecated in #14411. We should align files being returned as tool result output to work similar to how files are being passed in top-level messages. ## Summary This PR introduces a single canonical `file` content-part variant for tool-result outputs that mirrors the top-level `FilePart`: `{ type: 'file', mediaType, filename?, data: { type: 'data' | 'url' | 'reference' | 'text', ... } }`. - **`provider` (v4 spec)**: `LanguageModelV4ToolResultOutput.value` now carries a single tagged `file` variant. Spec break — atomic update across spec + provider adapters. - **`provider-utils`**: top-level `ToolResultOutput` content array gets the new `file` variant added; every legacy `file-*` and `image-*` variant stays in place and is annotated `@deprecated` with a message pointing at `file`, for back compat. - **`ai` (`mapToolResultOutput`)**: the conversion seam normalizes every legacy case into the new `type: 'file'` shape and emits exactly one `DeprecationWarning` per legacy item. - **`mcp`**: client emits the new shape directly. - **Examples + docs**: every `toModelOutput`-emitting example and the tool-calling guide use the canonical shape. Top-level `ToolResultOutput` is fully backward compatible (legacy variants still accepted; the seam normalizes them with a deprecation warning). The v4 spec change is a breaking change for direct `LanguageModelV4` consumers. ## Manual Verification Examples using `toModelOutput` can be run to verify the changes. ## Checklist - [x] All commits are signed (PRs with unsigned commits cannot be merged) - [x] Tests have been added / updated (for bug fixes / features) - [x] Documentation has been added / updated (for bug fixes / features) - [x] A _patch_ changeset for relevant packages has been added (for bug fixes / features - run `pnpm changeset` in the project root) - [x] I have reviewed this pull request (self-review) ## Future Work Eventually remove the deprecated legacy `file-*`/`image-*`/`*-id` content-part variants from `ToolResultOutput` and remove the auto-migration as part of it. ## Related Issues Technically a follow-up to #14010.
## Summary This PR adds a brief script that simplifies using git worktrees with AI SDK. - symlinks `.env` files present - runs `pnpm install` Guardrails are included to only run this in a linked worktree (not the main worktree), and only from the worktree root. ### Usage ```bash pnpm worktree:setup ``` People using git worktrees can automate this so that the command is always called when creating a new worktree. Contributing docs mention this too. ## Checklist - [x] All commits are signed (PRs with unsigned commits cannot be merged) - [ ] Tests have been added / updated (for bug fixes / features) - [ ] Documentation has been added / updated (for bug fixes / features) - [ ] A _patch_ changeset for relevant packages has been added (for bug fixes / features - run `pnpm changeset` in the project root) - [x] I have reviewed this pull request (self-review)
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ `main` is currently in **pre mode** so this branch has prereleases rather than normal releases. If you want to exit prereleases, run `changeset pre exit` on `main`.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ # Releases ## ai@7.0.0-canary.120 ### Major Changes - 5463d0d: feat(provider): align tool result output content file part types with top-level message file part types ### Patch Changes - Updated dependencies [5463d0d] - @ai-sdk/provider-utils@5.0.0-canary.32 - @ai-sdk/provider@4.0.0-canary.16 - @ai-sdk/gateway@4.0.0-canary.70 ## @ai-sdk/provider@4.0.0-canary.16 ### Major Changes - 5463d0d: feat(provider): align tool result output content file part types with top-level message file part types ## @ai-sdk/provider-utils@5.0.0-canary.32 ### Major Changes - 5463d0d: feat(provider): align tool result output content file part types with top-level message file part types ### Patch Changes - Updated dependencies [5463d0d] - @ai-sdk/provider@4.0.0-canary.16 ## @ai-sdk/alibaba@2.0.0-canary.41 ### Patch Changes - Updated dependencies [5463d0d] - @ai-sdk/provider-utils@5.0.0-canary.32 - @ai-sdk/provider@4.0.0-canary.16 - @ai-sdk/openai-compatible@3.0.0-canary.39 ## @ai-sdk/amazon-bedrock@5.0.0-canary.49 ### Patch Changes - 5463d0d: feat(provider): align tool result output content file part types with top-level message file part types - Updated dependencies [5463d0d] - @ai-sdk/provider-utils@5.0.0-canary.32 - @ai-sdk/provider@4.0.0-canary.16 - @ai-sdk/anthropic@4.0.0-canary.44 ## @ai-sdk/angular@3.0.0-canary.120 ### Patch Changes - Updated dependencies [5463d0d] - @ai-sdk/provider-utils@5.0.0-canary.32 - ai@7.0.0-canary.120 ## @ai-sdk/anthropic@4.0.0-canary.44 ### Patch Changes - 5463d0d: feat(provider): align tool result output content file part types with top-level message file part types - Updated dependencies [5463d0d] - @ai-sdk/provider-utils@5.0.0-canary.32 - @ai-sdk/provider@4.0.0-canary.16 ## @ai-sdk/assemblyai@3.0.0-canary.34 ### Patch Changes - Updated dependencies [5463d0d] - @ai-sdk/provider-utils@5.0.0-canary.32 - @ai-sdk/provider@4.0.0-canary.16 ## @ai-sdk/azure@4.0.0-canary.47 ### Patch Changes - Updated dependencies [5463d0d] - @ai-sdk/provider-utils@5.0.0-canary.32 - @ai-sdk/provider@4.0.0-canary.16 - @ai-sdk/openai@4.0.0-canary.47 ## @ai-sdk/baseten@2.0.0-canary.39 ### Patch Changes - Updated dependencies [5463d0d] - @ai-sdk/provider-utils@5.0.0-canary.32 - @ai-sdk/provider@4.0.0-canary.16 - @ai-sdk/openai-compatible@3.0.0-canary.39 ## @ai-sdk/black-forest-labs@2.0.0-canary.33 ### Patch Changes - Updated dependencies [5463d0d] - @ai-sdk/provider-utils@5.0.0-canary.32 - @ai-sdk/provider@4.0.0-canary.16 ## @ai-sdk/bytedance@2.0.0-canary.34 ### Patch Changes - Updated dependencies [5463d0d] - @ai-sdk/provider-utils@5.0.0-canary.32 - @ai-sdk/provider@4.0.0-canary.16 ## @ai-sdk/cerebras@3.0.0-canary.39 ### Patch Changes - Updated dependencies [5463d0d] - @ai-sdk/provider-utils@5.0.0-canary.32 - @ai-sdk/provider@4.0.0-canary.16 - @ai-sdk/openai-compatible@3.0.0-canary.39 ## @ai-sdk/cohere@4.0.0-canary.35 ### Patch Changes - Updated dependencies [5463d0d] - @ai-sdk/provider-utils@5.0.0-canary.32 - @ai-sdk/provider@4.0.0-canary.16 ## @ai-sdk/deepgram@3.0.0-canary.33 ### Patch Changes - Updated dependencies [5463d0d] - @ai-sdk/provider-utils@5.0.0-canary.32 - @ai-sdk/provider@4.0.0-canary.16 ## @ai-sdk/deepinfra@3.0.0-canary.39 ### Patch Changes - Updated dependencies [5463d0d] - @ai-sdk/provider-utils@5.0.0-canary.32 - @ai-sdk/provider@4.0.0-canary.16 - @ai-sdk/openai-compatible@3.0.0-canary.39 ## @ai-sdk/deepseek@3.0.0-canary.35 ### Patch Changes - Updated dependencies [5463d0d] - @ai-sdk/provider-utils@5.0.0-canary.32 - @ai-sdk/provider@4.0.0-canary.16 ## @ai-sdk/devtools@1.0.0-canary.21 ### Patch Changes - Updated dependencies [5463d0d] - @ai-sdk/provider@4.0.0-canary.16 ## @ai-sdk/elevenlabs@3.0.0-canary.33 ### Patch Changes - Updated dependencies [5463d0d] - @ai-sdk/provider-utils@5.0.0-canary.32 - @ai-sdk/provider@4.0.0-canary.16 ## @ai-sdk/fal@3.0.0-canary.33 ### Patch Changes - Updated dependencies [5463d0d] - @ai-sdk/provider-utils@5.0.0-canary.32 - @ai-sdk/provider@4.0.0-canary.16 ## @ai-sdk/fireworks@3.0.0-canary.39 ### Patch Changes - Updated dependencies [5463d0d] - @ai-sdk/provider-utils@5.0.0-canary.32 - @ai-sdk/provider@4.0.0-canary.16 - @ai-sdk/openai-compatible@3.0.0-canary.39 ## @ai-sdk/gateway@4.0.0-canary.70 ### Patch Changes - Updated dependencies [5463d0d] - @ai-sdk/provider-utils@5.0.0-canary.32 - @ai-sdk/provider@4.0.0-canary.16 ## @ai-sdk/gladia@3.0.0-canary.33 ### Patch Changes - Updated dependencies [5463d0d] - @ai-sdk/provider-utils@5.0.0-canary.32 - @ai-sdk/provider@4.0.0-canary.16 ## @ai-sdk/google@4.0.0-canary.51 ### Patch Changes - 5463d0d: feat(provider): align tool result output content file part types with top-level message file part types - Updated dependencies [5463d0d] - @ai-sdk/provider-utils@5.0.0-canary.32 - @ai-sdk/provider@4.0.0-canary.16 ## @ai-sdk/google-vertex@5.0.0-canary.69 ### Patch Changes - Updated dependencies [5463d0d] - @ai-sdk/provider-utils@5.0.0-canary.32 - @ai-sdk/provider@4.0.0-canary.16 - @ai-sdk/anthropic@4.0.0-canary.44 - @ai-sdk/google@4.0.0-canary.51 - @ai-sdk/openai-compatible@3.0.0-canary.39 ## @ai-sdk/groq@4.0.0-canary.36 ### Patch Changes - Updated dependencies [5463d0d] - @ai-sdk/provider-utils@5.0.0-canary.32 - @ai-sdk/provider@4.0.0-canary.16 ## @ai-sdk/huggingface@2.0.0-canary.39 ### Patch Changes - Updated dependencies [5463d0d] - @ai-sdk/provider-utils@5.0.0-canary.32 - @ai-sdk/provider@4.0.0-canary.16 - @ai-sdk/openai-compatible@3.0.0-canary.39 ## @ai-sdk/hume@3.0.0-canary.33 ### Patch Changes - Updated dependencies [5463d0d] - @ai-sdk/provider-utils@5.0.0-canary.32 - @ai-sdk/provider@4.0.0-canary.16 ## @ai-sdk/klingai@4.0.0-canary.34 ### Patch Changes - Updated dependencies [5463d0d] - @ai-sdk/provider-utils@5.0.0-canary.32 - @ai-sdk/provider@4.0.0-canary.16 ## @ai-sdk/langchain@3.0.0-canary.120 ### Patch Changes - Updated dependencies [5463d0d] - ai@7.0.0-canary.120 ## @ai-sdk/llamaindex@3.0.0-canary.120 ### Patch Changes - Updated dependencies [5463d0d] - ai@7.0.0-canary.120 ## @ai-sdk/lmnt@3.0.0-canary.33 ### Patch Changes - Updated dependencies [5463d0d] - @ai-sdk/provider-utils@5.0.0-canary.32 - @ai-sdk/provider@4.0.0-canary.16 ## @ai-sdk/luma@3.0.0-canary.33 ### Patch Changes - Updated dependencies [5463d0d] - @ai-sdk/provider-utils@5.0.0-canary.32 - @ai-sdk/provider@4.0.0-canary.16 ## @ai-sdk/mcp@2.0.0-canary.39 ### Patch Changes - 5463d0d: feat(provider): align tool result output content file part types with top-level message file part types - Updated dependencies [5463d0d] - @ai-sdk/provider-utils@5.0.0-canary.32 - @ai-sdk/provider@4.0.0-canary.16 ## @ai-sdk/mistral@4.0.0-canary.37 ### Patch Changes - 5463d0d: feat(provider): align tool result output content file part types with top-level message file part types - Updated dependencies [5463d0d] - @ai-sdk/provider-utils@5.0.0-canary.32 - @ai-sdk/provider@4.0.0-canary.16 ## @ai-sdk/moonshotai@3.0.0-canary.39 ### Patch Changes - Updated dependencies [5463d0d] - @ai-sdk/provider-utils@5.0.0-canary.32 - @ai-sdk/provider@4.0.0-canary.16 - @ai-sdk/openai-compatible@3.0.0-canary.39 ## @ai-sdk/open-responses@2.0.0-canary.35 ### Patch Changes - 5463d0d: feat(provider): align tool result output content file part types with top-level message file part types - Updated dependencies [5463d0d] - @ai-sdk/provider-utils@5.0.0-canary.32 - @ai-sdk/provider@4.0.0-canary.16 ## @ai-sdk/openai@4.0.0-canary.47 ### Patch Changes - 5463d0d: feat(provider): align tool result output content file part types with top-level message file part types - Updated dependencies [5463d0d] - @ai-sdk/provider-utils@5.0.0-canary.32 - @ai-sdk/provider@4.0.0-canary.16 ## @ai-sdk/openai-compatible@3.0.0-canary.39 ### Patch Changes - Updated dependencies [5463d0d] - @ai-sdk/provider-utils@5.0.0-canary.32 - @ai-sdk/provider@4.0.0-canary.16 ## @ai-sdk/otel@1.0.0-canary.66 ### Patch Changes - Updated dependencies [5463d0d] - @ai-sdk/provider@4.0.0-canary.16 - ai@7.0.0-canary.120 ## @ai-sdk/perplexity@4.0.0-canary.36 ### Patch Changes - Updated dependencies [5463d0d] - @ai-sdk/provider-utils@5.0.0-canary.32 - @ai-sdk/provider@4.0.0-canary.16 ## @ai-sdk/prodia@2.0.0-canary.36 ### Patch Changes - Updated dependencies [5463d0d] - @ai-sdk/provider-utils@5.0.0-canary.32 - @ai-sdk/provider@4.0.0-canary.16 ## @ai-sdk/react@4.0.0-canary.120 ### Patch Changes - Updated dependencies [5463d0d] - @ai-sdk/provider-utils@5.0.0-canary.32 - ai@7.0.0-canary.120 ## @ai-sdk/replicate@3.0.0-canary.34 ### Patch Changes - Updated dependencies [5463d0d] - @ai-sdk/provider-utils@5.0.0-canary.32 - @ai-sdk/provider@4.0.0-canary.16 ## @ai-sdk/revai@3.0.0-canary.34 ### Patch Changes - Updated dependencies [5463d0d] - @ai-sdk/provider-utils@5.0.0-canary.32 - @ai-sdk/provider@4.0.0-canary.16 ## @ai-sdk/rsc@3.0.0-canary.121 ### Patch Changes - Updated dependencies [5463d0d] - @ai-sdk/provider-utils@5.0.0-canary.32 - @ai-sdk/provider@4.0.0-canary.16 - ai@7.0.0-canary.120 ## @ai-sdk/svelte@5.0.0-canary.120 ### Patch Changes - Updated dependencies [5463d0d] - @ai-sdk/provider-utils@5.0.0-canary.32 - ai@7.0.0-canary.120 ## @ai-sdk/togetherai@3.0.0-canary.39 ### Patch Changes - Updated dependencies [5463d0d] - @ai-sdk/provider-utils@5.0.0-canary.32 - @ai-sdk/provider@4.0.0-canary.16 - @ai-sdk/openai-compatible@3.0.0-canary.39 ## @ai-sdk/valibot@3.0.0-canary.32 ### Patch Changes - Updated dependencies [5463d0d] - @ai-sdk/provider-utils@5.0.0-canary.32 ## @ai-sdk/vercel@3.0.0-canary.39 ### Patch Changes - Updated dependencies [5463d0d] - @ai-sdk/provider-utils@5.0.0-canary.32 - @ai-sdk/provider@4.0.0-canary.16 - @ai-sdk/openai-compatible@3.0.0-canary.39 ## @ai-sdk/voyage@1.0.0-canary.6 ### Patch Changes - Updated dependencies [5463d0d] - @ai-sdk/provider-utils@5.0.0-canary.32 - @ai-sdk/provider@4.0.0-canary.16 ## @ai-sdk/vue@4.0.0-canary.120 ### Patch Changes - Updated dependencies [5463d0d] - @ai-sdk/provider-utils@5.0.0-canary.32 - ai@7.0.0-canary.120 ## @ai-sdk/workflow@1.0.0-canary.35 ### Patch Changes - Updated dependencies [5463d0d] - @ai-sdk/provider-utils@5.0.0-canary.32 - @ai-sdk/provider@4.0.0-canary.16 - ai@7.0.0-canary.120 ## @ai-sdk/xai@4.0.0-canary.52 ### Patch Changes - Updated dependencies [5463d0d] - @ai-sdk/provider-utils@5.0.0-canary.32 - @ai-sdk/provider@4.0.0-canary.16 - @ai-sdk/openai-compatible@3.0.0-canary.39 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
## Background [OpenAI released GPT-5.5.](https://developers.openai.com/api/docs/models/gpt-5.5) ## Summary Add GPT-5.5 model IDs.
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ `main` is currently in **pre mode** so this branch has prereleases rather than normal releases. If you want to exit prereleases, run `changeset pre exit` on `main`.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ # Releases ## @ai-sdk/azure@4.0.0-canary.48 ### Patch Changes - Updated dependencies [d6c79e3] - @ai-sdk/openai@4.0.0-canary.48 ## @ai-sdk/openai@4.0.0-canary.48 ### Patch Changes - d6c79e3: feat(openai): add GPT-5.5 chat model IDs Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…gnature (#14968) ## Background Vertex emits a no-args function call as a single chunk shaped `{ functionCall: { name: 'X' } }` with no `args`, no `partialArgs`, and no `willContinue`. The streaming parser in `google-language-model.ts` classifies chunks into `isStreamingChunk` / `isTerminalChunk` / `isCompleteCall`, and a no-args call matches none of them — so it falls through and is silently dropped. The unary (`doGenerate`) path has the same drop because of an `args != null` guard. For Gemini 3 thinking models that one dropped chunk also carries the response's `thoughtSignature`. Vertex enforces a multi-turn rule: an assistant turn containing any function calls must contain at least one with a `thoughtSignature`. When the dropped call is the first call (the one with the sig), the next agent step 400s with `missing thought_signature`. ## Summary - Streaming path: add a fourth classifier `isNoArgsCompleteCall` that matches `{ name: X }` with no `args` / `partialArgs` / `willContinue !== true`, and emit `tool-input-start` → `tool-input-end` → `tool-call` with `'{}'` input, propagating `providerMetadata` (so `thoughtSignature` survives). - Unary path: stop requiring `args != null`. Use `JSON.stringify(args ?? {})` so a no-args complete call from `doGenerate` is also emitted instead of dropped. ## Manual Verification See #14968 description --- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-authored-by: Rayan Salhab <cyphercodes@users.noreply.github.com> Co-authored-by: Paul Elliot <paulelliotco@users.noreply.github.com>
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ `main` is currently in **pre mode** so this branch has prereleases rather than normal releases. If you want to exit prereleases, run `changeset pre exit` on `main`.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ # Releases ## @ai-sdk/google@4.0.0-canary.52 ### Patch Changes - cfca634: fix(google): emit Vertex no-args streaming tool calls and preserve thoughtSignature Vertex emits a no-args function call as a single chunk shaped `{ functionCall: { name: 'X' } }` with no `args`, no `partialArgs`, and no `willContinue`. The streaming parser had no branch for this shape, so the call was dropped along with any `thoughtSignature` it carried. For Gemini 3 thinking models this caused the next multi-turn step to 400 with `missing thought_signature`. The unary (`doGenerate`) path had the same drop. Both paths now emit the call as a complete tool call with `'{}'` input and propagate `thoughtSignature` provider metadata. Fixes #14847. ## @ai-sdk/google-vertex@5.0.0-canary.70 ### Patch Changes - Updated dependencies [cfca634] - @ai-sdk/google@4.0.0-canary.52 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…sult image content (#14970)
…ontext and make it opt-in (#14995) ## Background The `sensitiveRuntimeContext` for excluding runtime context properties from telemetry was introduced in #14757 However, it should be secure-by-default, ie runtime context properties should only be exposed to telemetry if they have been explicitly marked for that purpose. ## Summary * move `sensitiveRuntimeContext` to `telemetry.includeRuntimeContext` * make it opt-in, i.e. runtime context properties have to be marked as `true` to be forwarded to telemetry ## Manual Verification Run examples and verify telemetry logging - [x] `examples/ai-functions/src/telemetry/console/tool-loop-agent-generate.ts` - [x] `examples/ai-functions/src/telemetry/console/tool-loop-agent-stream.ts` ## Future Work * change the sensitive tool context in a similar way ## Related Issues Builds on #14757
…xt and make it opt-in (#14996) ## Background The sensitiveContext tool option for excluding tool context properties from telemetry was introduced in #14777 However, it should be secure-by-default, ie runtime context properties should only be exposed to telemetry if they have been explicitly marked for that purpose. ## Summary * move `sensitiveContext` from `Tool` to `telemetry.includeToolsContext` * make it opt-in, i.e. tools context properties have to be marked as `true` to be forwarded to telemetry ## Manual Verification Run examples and verify telemetry logging - [x] `examples/ai-functions/src/telemetry/console/tool-loop-agent-generate.ts` - [x] `examples/ai-functions/src/telemetry/console/tool-loop-agent-stream.ts` ## Related Issues Builds on #14777 Follow up from #14995
## Background pnpm 10 stores transient files in `.pnpm-store`. This adds many unwanted files to git changes. ## Summary Add `.pnpm-store` to `.gitignore`
…enerateText, streamText (#15000) ## Background Different LLM provider might generate slightly different tool inputs for the same tool input type, e.g. using empty string instead of `null`. Tools might come from 3rd party providers, so the input schemas might not support refinement. ## Summary Add an experimental `refineToolInput` option to `ToolLoopAgent`, `generateText`, `streamText` that can be used to modify the tool inputs as long as the expected type is retained. ## Manual Verification Execute examples and check tool inputs: - [x] `examples/ai-functions/src/generate-text/openai/refine-tool-input.ts` - [x] `examples/ai-functions/src/steam-text/openai/refine-tool-input.ts`
…14894) ## Background Bedrock's Converse Stream API never includes `input` on a tool-use `contentBlockStart` event — only `toolUseId` and `name`; the JSON args arrive in subsequent `contentBlockDelta` chunks. `BedrockToolUseSchema` declared `input: z.unknown()`, which used to accept a missing key but no longer does under Zod >= 4.4.0, where `z.unknown()` in an object shape is required (`expected: "nonoptional"`). Result: every tool call against Bedrock throws `AI_TypeValidationError` on the very first stream event. ## Summary Mark `input` explicitly `.optional()` on `AmazonBedrockToolUseSchema` so the schema matches the wire protocol and parses under both old and new Zod semantics. Also added a changeset. ## Manual Verification Ran `pnpm test:node` in `packages/amazon-bedrock` — all 362 tests pass, including `should stream tool deltas` which already feeds a `contentBlockStart` payload with no `input` field through the schema. ## Checklist - [x] All commits are signed (PRs with unsigned commits cannot be merged) - [x] Tests have been added / updated (for bug fixes / features) - [ ] Documentation has been added / updated (for bug fixes / features) - [x] A _patch_ changeset for relevant packages has been added (for bug fixes / features - run `pnpm changeset` in the project root) - [x] I have reviewed this pull request (self-review) ## Related Issues Fixes #14892 --------- Co-authored-by: Aayush Kapoor <83492835+aayush-kapoor@users.noreply.github.com> Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
## Background as a follow up to #14813, we needed to align the variables with proper naming so as to not create any confusion ## Summary deprecated the `name` property and renamed to `clientName` since it's just defined in `createMCPClient()` ## Manual Verification verified by running the example `http://localhost:3000/chat/mcp` ## Checklist - [x] All commits are signed (PRs with unsigned commits cannot be merged) - [x] Tests have been added / updated (for bug fixes / features) - [x] Documentation has been added / updated (for bug fixes / features) - [x] A _patch_ changeset for relevant packages has been added (for bug fixes / features - run `pnpm changeset` in the project root) - [x] I have reviewed this pull request (self-review) ## Future Work compile the providerMetadata properties available for MCP tools into separate type
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ `main` is currently in **pre mode** so this branch has prereleases rather than normal releases. If you want to exit prereleases, run `changeset pre exit` on `main`.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ # Releases ## ai@7.0.0-canary.121 ### Patch Changes - 2427d88: feat(ai): change Tool.sensitiveContext to telemetry.includeToolsContext and make it opt-in - 5588abd: feat(ai): add experimental_refineToolInput option to ToolLoopAgent, generateText, streamText - 6dd6b83: feat(ai): change sensitiveRuntimeContext to telemetry.includeRuntimeContext and make it opt-in - Updated dependencies [2427d88] - @ai-sdk/provider-utils@5.0.0-canary.33 - @ai-sdk/gateway@4.0.0-canary.71 ## @ai-sdk/alibaba@2.0.0-canary.42 ### Patch Changes - Updated dependencies [2427d88] - @ai-sdk/provider-utils@5.0.0-canary.33 - @ai-sdk/openai-compatible@3.0.0-canary.40 ## @ai-sdk/amazon-bedrock@5.0.0-canary.50 ### Patch Changes - 68c5081: fix(provider/amazon-bedrock): mark `input` optional on tool-use schema so streaming `contentBlockStart` events parse under Zod >= 4.4.0 - Updated dependencies [2427d88] - @ai-sdk/provider-utils@5.0.0-canary.33 - @ai-sdk/anthropic@4.0.0-canary.45 ## @ai-sdk/angular@3.0.0-canary.121 ### Patch Changes - Updated dependencies [2427d88] - Updated dependencies [5588abd] - Updated dependencies [6dd6b83] - @ai-sdk/provider-utils@5.0.0-canary.33 - ai@7.0.0-canary.121 ## @ai-sdk/anthropic@4.0.0-canary.45 ### Patch Changes - Updated dependencies [2427d88] - @ai-sdk/provider-utils@5.0.0-canary.33 ## @ai-sdk/assemblyai@3.0.0-canary.35 ### Patch Changes - Updated dependencies [2427d88] - @ai-sdk/provider-utils@5.0.0-canary.33 ## @ai-sdk/azure@4.0.0-canary.49 ### Patch Changes - Updated dependencies [2427d88] - Updated dependencies [7bbc194] - @ai-sdk/provider-utils@5.0.0-canary.33 - @ai-sdk/openai@4.0.0-canary.49 ## @ai-sdk/baseten@2.0.0-canary.40 ### Patch Changes - Updated dependencies [2427d88] - @ai-sdk/provider-utils@5.0.0-canary.33 - @ai-sdk/openai-compatible@3.0.0-canary.40 ## @ai-sdk/black-forest-labs@2.0.0-canary.34 ### Patch Changes - Updated dependencies [2427d88] - @ai-sdk/provider-utils@5.0.0-canary.33 ## @ai-sdk/bytedance@2.0.0-canary.35 ### Patch Changes - Updated dependencies [2427d88] - @ai-sdk/provider-utils@5.0.0-canary.33 ## @ai-sdk/cerebras@3.0.0-canary.40 ### Patch Changes - Updated dependencies [2427d88] - @ai-sdk/provider-utils@5.0.0-canary.33 - @ai-sdk/openai-compatible@3.0.0-canary.40 ## @ai-sdk/cohere@4.0.0-canary.36 ### Patch Changes - Updated dependencies [2427d88] - @ai-sdk/provider-utils@5.0.0-canary.33 ## @ai-sdk/deepgram@3.0.0-canary.34 ### Patch Changes - Updated dependencies [2427d88] - @ai-sdk/provider-utils@5.0.0-canary.33 ## @ai-sdk/deepinfra@3.0.0-canary.40 ### Patch Changes - Updated dependencies [2427d88] - @ai-sdk/provider-utils@5.0.0-canary.33 - @ai-sdk/openai-compatible@3.0.0-canary.40 ## @ai-sdk/deepseek@3.0.0-canary.36 ### Patch Changes - Updated dependencies [2427d88] - @ai-sdk/provider-utils@5.0.0-canary.33 ## @ai-sdk/elevenlabs@3.0.0-canary.34 ### Patch Changes - Updated dependencies [2427d88] - @ai-sdk/provider-utils@5.0.0-canary.33 ## @ai-sdk/fal@3.0.0-canary.34 ### Patch Changes - Updated dependencies [2427d88] - @ai-sdk/provider-utils@5.0.0-canary.33 ## @ai-sdk/fireworks@3.0.0-canary.40 ### Patch Changes - Updated dependencies [2427d88] - @ai-sdk/provider-utils@5.0.0-canary.33 - @ai-sdk/openai-compatible@3.0.0-canary.40 ## @ai-sdk/gateway@4.0.0-canary.71 ### Patch Changes - Updated dependencies [2427d88] - @ai-sdk/provider-utils@5.0.0-canary.33 ## @ai-sdk/gladia@3.0.0-canary.34 ### Patch Changes - Updated dependencies [2427d88] - @ai-sdk/provider-utils@5.0.0-canary.33 ## @ai-sdk/google@4.0.0-canary.53 ### Patch Changes - Updated dependencies [2427d88] - @ai-sdk/provider-utils@5.0.0-canary.33 ## @ai-sdk/google-vertex@5.0.0-canary.71 ### Patch Changes - Updated dependencies [2427d88] - @ai-sdk/provider-utils@5.0.0-canary.33 - @ai-sdk/anthropic@4.0.0-canary.45 - @ai-sdk/google@4.0.0-canary.53 - @ai-sdk/openai-compatible@3.0.0-canary.40 ## @ai-sdk/groq@4.0.0-canary.37 ### Patch Changes - Updated dependencies [2427d88] - @ai-sdk/provider-utils@5.0.0-canary.33 ## @ai-sdk/huggingface@2.0.0-canary.40 ### Patch Changes - Updated dependencies [2427d88] - @ai-sdk/provider-utils@5.0.0-canary.33 - @ai-sdk/openai-compatible@3.0.0-canary.40 ## @ai-sdk/hume@3.0.0-canary.34 ### Patch Changes - Updated dependencies [2427d88] - @ai-sdk/provider-utils@5.0.0-canary.33 ## @ai-sdk/klingai@4.0.0-canary.35 ### Patch Changes - Updated dependencies [2427d88] - @ai-sdk/provider-utils@5.0.0-canary.33 ## @ai-sdk/langchain@3.0.0-canary.121 ### Patch Changes - Updated dependencies [2427d88] - Updated dependencies [5588abd] - Updated dependencies [6dd6b83] - ai@7.0.0-canary.121 ## @ai-sdk/llamaindex@3.0.0-canary.121 ### Patch Changes - Updated dependencies [2427d88] - Updated dependencies [5588abd] - Updated dependencies [6dd6b83] - ai@7.0.0-canary.121 ## @ai-sdk/lmnt@3.0.0-canary.34 ### Patch Changes - Updated dependencies [2427d88] - @ai-sdk/provider-utils@5.0.0-canary.33 ## @ai-sdk/luma@3.0.0-canary.34 ### Patch Changes - Updated dependencies [2427d88] - @ai-sdk/provider-utils@5.0.0-canary.33 ## @ai-sdk/mcp@2.0.0-canary.40 ### Patch Changes - Updated dependencies [2427d88] - @ai-sdk/provider-utils@5.0.0-canary.33 ## @ai-sdk/mistral@4.0.0-canary.38 ### Patch Changes - Updated dependencies [2427d88] - @ai-sdk/provider-utils@5.0.0-canary.33 ## @ai-sdk/moonshotai@3.0.0-canary.40 ### Patch Changes - Updated dependencies [2427d88] - @ai-sdk/provider-utils@5.0.0-canary.33 - @ai-sdk/openai-compatible@3.0.0-canary.40 ## @ai-sdk/open-responses@2.0.0-canary.36 ### Patch Changes - Updated dependencies [2427d88] - @ai-sdk/provider-utils@5.0.0-canary.33 ## @ai-sdk/openai@4.0.0-canary.49 ### Patch Changes - 7bbc194: feat(provider/openai): forward imageDetail providerOptions on tool-result image content - Updated dependencies [2427d88] - @ai-sdk/provider-utils@5.0.0-canary.33 ## @ai-sdk/openai-compatible@3.0.0-canary.40 ### Patch Changes - Updated dependencies [2427d88] - @ai-sdk/provider-utils@5.0.0-canary.33 ## @ai-sdk/otel@1.0.0-canary.67 ### Patch Changes - Updated dependencies [2427d88] - Updated dependencies [5588abd] - Updated dependencies [6dd6b83] - ai@7.0.0-canary.121 ## @ai-sdk/perplexity@4.0.0-canary.37 ### Patch Changes - Updated dependencies [2427d88] - @ai-sdk/provider-utils@5.0.0-canary.33 ## @ai-sdk/prodia@2.0.0-canary.37 ### Patch Changes - Updated dependencies [2427d88] - @ai-sdk/provider-utils@5.0.0-canary.33 ## @ai-sdk/provider-utils@5.0.0-canary.33 ### Patch Changes - 2427d88: feat(ai): change Tool.sensitiveContext to telemetry.includeToolsContext and make it opt-in ## @ai-sdk/react@4.0.0-canary.121 ### Patch Changes - Updated dependencies [2427d88] - Updated dependencies [5588abd] - Updated dependencies [6dd6b83] - @ai-sdk/provider-utils@5.0.0-canary.33 - ai@7.0.0-canary.121 ## @ai-sdk/replicate@3.0.0-canary.35 ### Patch Changes - Updated dependencies [2427d88] - @ai-sdk/provider-utils@5.0.0-canary.33 ## @ai-sdk/revai@3.0.0-canary.35 ### Patch Changes - Updated dependencies [2427d88] - @ai-sdk/provider-utils@5.0.0-canary.33 ## @ai-sdk/rsc@3.0.0-canary.122 ### Patch Changes - Updated dependencies [2427d88] - Updated dependencies [5588abd] - Updated dependencies [6dd6b83] - @ai-sdk/provider-utils@5.0.0-canary.33 - ai@7.0.0-canary.121 ## @ai-sdk/svelte@5.0.0-canary.121 ### Patch Changes - Updated dependencies [2427d88] - Updated dependencies [5588abd] - Updated dependencies [6dd6b83] - @ai-sdk/provider-utils@5.0.0-canary.33 - ai@7.0.0-canary.121 ## @ai-sdk/togetherai@3.0.0-canary.40 ### Patch Changes - Updated dependencies [2427d88] - @ai-sdk/provider-utils@5.0.0-canary.33 - @ai-sdk/openai-compatible@3.0.0-canary.40 ## @ai-sdk/valibot@3.0.0-canary.33 ### Patch Changes - Updated dependencies [2427d88] - @ai-sdk/provider-utils@5.0.0-canary.33 ## @ai-sdk/vercel@3.0.0-canary.40 ### Patch Changes - Updated dependencies [2427d88] - @ai-sdk/provider-utils@5.0.0-canary.33 - @ai-sdk/openai-compatible@3.0.0-canary.40 ## @ai-sdk/voyage@1.0.0-canary.7 ### Patch Changes - Updated dependencies [2427d88] - @ai-sdk/provider-utils@5.0.0-canary.33 ## @ai-sdk/vue@4.0.0-canary.121 ### Patch Changes - Updated dependencies [2427d88] - Updated dependencies [5588abd] - Updated dependencies [6dd6b83] - @ai-sdk/provider-utils@5.0.0-canary.33 - ai@7.0.0-canary.121 ## @ai-sdk/workflow@1.0.0-canary.36 ### Patch Changes - Updated dependencies [2427d88] - Updated dependencies [5588abd] - Updated dependencies [6dd6b83] - @ai-sdk/provider-utils@5.0.0-canary.33 - ai@7.0.0-canary.121 ## @ai-sdk/xai@4.0.0-canary.53 ### Patch Changes - Updated dependencies [2427d88] - @ai-sdk/provider-utils@5.0.0-canary.33 - @ai-sdk/openai-compatible@3.0.0-canary.40 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
#15484) ## Background #14703 when the tsconfig property `exactOptionalPropertyTypes: true` is set, a `UIMessage` cannot be assigned from a structurally equivalent value if the input field on an `input-streaming` tool part is declared as optional. the types require the input key to exist. But the validator [already allows](https://github.com/vercel/ai/blob/main/packages/ai/src/ui/validate-ui-messages.ts#L96) it to be absent ## Summary continued from #14990 + added a focused test ## Manual Verification na ## Checklist - [x] All commits are signed (PRs with unsigned commits cannot be merged) - [x] Tests have been added / updated (for bug fixes / features) - [ ] Documentation has been added / updated (for bug fixes / features) - [x] A _patch_ changeset for relevant packages has been added (for bug fixes / features - run `pnpm changeset` in the project root) - [x] I have reviewed this pull request (self-review) ## Related Issues fixes #14703 Co-authored-by: Mmartinrusso <maartinrusso@gmail.com>
…verride (#15483) Adding support for `role: system` messages for `ToolLoopAgent`. Both `generateText` and `streamText` allow for a `allowSystemInMessages` argument to enable system messages – updating ToolLoopAgent to accept this toggle as well. ``` const agent = new ToolLoopAgent({ model, tools, allowSystemInMessages: true, }); await createAgentUIStream({ agent, uiMessages: [ { role: "system", content: "Server context" }, { role: "user", content: "Hello" }, ], }); ``` ``` const agent = new ToolLoopAgent({ model, tools, prepareCall: ({ messages, options }) => { return { ...options, messages, allowSystemInMessages: true, // Can be conditional per-call }; }, }); ```
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ `main` is currently in **pre mode** so this branch has prereleases rather than normal releases. If you want to exit prereleases, run `changeset pre exit` on `main`.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ # Releases ## ai@7.0.0-canary.148 ### Patch Changes - 2852a84: fix(ai): make input optional on input-streaming UIMessagePart variants ## @ai-sdk/angular@3.0.0-canary.148 ### Patch Changes - Updated dependencies [2852a84] - ai@7.0.0-canary.148 ## @ai-sdk/langchain@3.0.0-canary.148 ### Patch Changes - Updated dependencies [2852a84] - ai@7.0.0-canary.148 ## @ai-sdk/llamaindex@3.0.0-canary.148 ### Patch Changes - Updated dependencies [2852a84] - ai@7.0.0-canary.148 ## @ai-sdk/otel@1.0.0-canary.94 ### Patch Changes - Updated dependencies [2852a84] - ai@7.0.0-canary.148 ## @ai-sdk/react@4.0.0-canary.149 ### Patch Changes - Updated dependencies [2852a84] - ai@7.0.0-canary.148 ## @ai-sdk/rsc@3.0.0-canary.149 ### Patch Changes - Updated dependencies [2852a84] - ai@7.0.0-canary.148 ## @ai-sdk/svelte@5.0.0-canary.148 ### Patch Changes - Updated dependencies [2852a84] - ai@7.0.0-canary.148 ## @ai-sdk/vue@4.0.0-canary.148 ### Patch Changes - Updated dependencies [2852a84] - ai@7.0.0-canary.148 ## @ai-sdk/workflow@1.0.0-canary.65 ### Patch Changes - Updated dependencies [2852a84] - ai@7.0.0-canary.148 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ `main` is currently in **pre mode** so this branch has prereleases rather than normal releases. If you want to exit prereleases, run `changeset pre exit` on `main`.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ # Releases ## ai@7.0.0-canary.149 ### Patch Changes - e3d9c0e: Add `allowSystemInMessages` option to `ToolLoopAgent`. This exposes the same option that exists on `streamText` and `generateText`, whether `role: "system"` messages are allowed in the `prompt` or `messages` fields. When unset, system messages are rejected because they can create a prompt injection attack risk. Ideally, use the `instructions` option instead. Set to `true` to allow system messages, or `false` to explicitly reject them. ```ts const agent = new ToolLoopAgent({ model, allowSystemInMessages: true, }); await agent.generate({ messages: [ { role: "system", content: "Server context" }, { role: "user", content: "Hello" }, ], }); ``` The option can also be returned from `prepareCall` for dynamic per-call configuration. ## @ai-sdk/angular@3.0.0-canary.149 ### Patch Changes - Updated dependencies [e3d9c0e] - ai@7.0.0-canary.149 ## @ai-sdk/langchain@3.0.0-canary.149 ### Patch Changes - Updated dependencies [e3d9c0e] - ai@7.0.0-canary.149 ## @ai-sdk/llamaindex@3.0.0-canary.149 ### Patch Changes - Updated dependencies [e3d9c0e] - ai@7.0.0-canary.149 ## @ai-sdk/otel@1.0.0-canary.95 ### Patch Changes - Updated dependencies [e3d9c0e] - ai@7.0.0-canary.149 ## @ai-sdk/react@4.0.0-canary.150 ### Patch Changes - Updated dependencies [e3d9c0e] - ai@7.0.0-canary.149 ## @ai-sdk/rsc@3.0.0-canary.150 ### Patch Changes - Updated dependencies [e3d9c0e] - ai@7.0.0-canary.149 ## @ai-sdk/svelte@5.0.0-canary.149 ### Patch Changes - Updated dependencies [e3d9c0e] - ai@7.0.0-canary.149 ## @ai-sdk/vue@4.0.0-canary.149 ### Patch Changes - Updated dependencies [e3d9c0e] - ai@7.0.0-canary.149 ## @ai-sdk/workflow@1.0.0-canary.66 ### Patch Changes - Updated dependencies [e3d9c0e] - ai@7.0.0-canary.149 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…#15488) ## Summary - The Gemini API returns the applied service tier in two places: the `x-gemini-service-tier` response header (non-streaming only) and `usageMetadata.serviceTier` in the response body (both streaming and non-streaming). - The previous implementation only read the header, so `providerMetadata.google.serviceTier` was always `null` on `streamText`. - Read `usageMetadata.serviceTier` from the body for both `doGenerate` and `doStream`. Single source of truth, no header involvement, matches the pattern Vertex already uses (`usageMetadata.trafficType`). - Docs updated to drop the implementation detail about where the value comes from. ## Test plan - [x] `pnpm test` in `packages/google` — 583 tests pass (node + edge), incl. two new tests asserting `serviceTier` is populated from `usageMetadata` in both generate and stream paths. - [x] `pnpm type-check:full` — clean. - [x] Verified live against the Gemini API: - `pnpm tsx src/generate-text/google/service-tier.ts` → `serviceTier: priority` (still works after dropping header read) - `pnpm tsx src/stream-text/google/service-tier.ts` → `serviceTier: priority` (previously `null`) - [x] Verified Vertex examples unaffected: - `pnpm tsx src/generate-text/google/vertex-service-tier.ts` → `trafficType: ON_DEMAND_PRIORITY` - `pnpm tsx src/stream-text/google/vertex-service-tier.ts` → `trafficType: ON_DEMAND_PRIORITY` 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ `main` is currently in **pre mode** so this branch has prereleases rather than normal releases. If you want to exit prereleases, run `changeset pre exit` on `main`.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ # Releases ## @ai-sdk/google@4.0.0-canary.71 ### Patch Changes - 045d2e8: fix(google): read `serviceTier` from `usageMetadata.serviceTier` in both generate and stream paths The previous implementation read `serviceTier` from the `x-gemini-service-tier` response header, which is only populated on non-streaming responses. Gemini streaming includes the value in `usageMetadata.serviceTier` on every chunk, so `providerMetadata.google.serviceTier` was always `null` for streams. Read from `usageMetadata` for both paths instead. ## @ai-sdk/google-vertex@5.0.0-canary.90 ### Patch Changes - Updated dependencies [045d2e8] - @ai-sdk/google@4.0.0-canary.71 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…e id (#15503) ## Background #15502 / reported in #15492 when `previousResponseId` is used with the openai provider, with `store: true`, we observe that duplicate reasoning items and function call items are being passed and the provider throws a 404 error. [openai docs highlight](https://developers.openai.com/cookbook/examples/responses_api/reasoning_items#:~:text=If%20you%20use%20previous_response_id%20for%20multi%2Dturn%20conversations%2C%20the%20model%20will%20automatically%20have%20access%20to%20all%20previously%20produced%20reasoning%20items.) that: > If you use previous_response_id for multi-turn conversations, the model will automatically have access to all previously produced reasoning items so it's fine if we skip passing those items under those conditions ## Summary - introduced a flag `hasPreviousResponseId` and if it does - we skip passing ONLY the reasoning items and function calls ## Manual Verification verified by running the repro in the issue: <details> <summary>repro:</summary> ```ts import { openai, type OpenaiResponsesProviderMetadata, type OpenAILanguageModelResponsesOptions, } from '@ai-sdk/openai'; import { isStepCount, streamText, tool } from 'ai'; import { z } from 'zod'; import { run } from '../../lib/run'; run(async () => { let previousResponseId: string | undefined; const result = streamText({ model: openai.responses('gpt-5-mini'), maxRetries: 0, stopWhen: isStepCount(2), tools: { getWeather: tool({ description: 'Get the weather in a city.', inputSchema: z.object({ city: z.string().describe('The city to get the weather for.'), }), execute: async ({ city }) => ({ city, weather: 'sunny', temperature: 72, }), }), }, prompt: 'Use the weather tool for San Francisco, then answer briefly.', reasoning: 'low', include: { requestBody: true, }, prepareStep: ({ stepNumber }) => ({ toolChoice: stepNumber === 0 ? { type: 'tool', toolName: 'getWeather' } : 'auto', providerOptions: { openai: { store: true, ...(previousResponseId != null ? { previousResponseId } : {}), } satisfies OpenAILanguageModelResponsesOptions, }, }), onStepFinish: step => { const providerMetadata = step.providerMetadata as | OpenaiResponsesProviderMetadata | undefined; previousResponseId = providerMetadata?.openai.responseId ?? previousResponseId; console.log('Step response ID:', previousResponseId); }, }); for await (const chunk of result.fullStream) { switch (chunk.type) { case 'start-step': console.log( 'Request body:', JSON.stringify(chunk.request.body, null, 2), ); break; case 'tool-call': console.log('Tool call:', chunk.toolName, chunk.input); break; case 'tool-result': console.log('Tool result:', chunk.output); break; case 'text-delta': process.stdout.write(chunk.text); break; case 'error': throw chunk.error; } } }); ``` </details> ## Checklist - [x] All commits are signed (PRs with unsigned commits cannot be merged) - [x] Tests have been added / updated (for bug fixes / features) - [ ] Documentation has been added / updated (for bug fixes / features) - [x] A _patch_ changeset for relevant packages has been added (for bug fixes / features - run `pnpm changeset` in the project root) - [x] I have reviewed this pull request (self-review) ## Related Issues fixes #15502
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ `main` is currently in **pre mode** so this branch has prereleases rather than normal releases. If you want to exit prereleases, run `changeset pre exit` on `main`.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ # Releases ## ai@7.0.0-canary.150 ### Patch Changes - Updated dependencies [bba5250] - Updated dependencies [94c6edc] - @ai-sdk/gateway@4.0.0-canary.89 ## @ai-sdk/alibaba@2.0.0-canary.53 ### Patch Changes - 94c6edc: Add `qwen3.7-max` model ID to Alibaba and AI Gateway. ## @ai-sdk/amazon-bedrock@5.0.0-canary.67 ### Patch Changes - Updated dependencies [17b5597] - @ai-sdk/openai@4.0.0-canary.63 ## @ai-sdk/angular@3.0.0-canary.150 ### Patch Changes - ai@7.0.0-canary.150 ## @ai-sdk/azure@4.0.0-canary.63 ### Patch Changes - Updated dependencies [17b5597] - @ai-sdk/openai@4.0.0-canary.63 ## @ai-sdk/gateway@4.0.0-canary.89 ### Patch Changes - bba5250: chore(provider/gateway): update gateway model settings files - 94c6edc: Add `qwen3.7-max` model ID to Alibaba and AI Gateway. ## @ai-sdk/langchain@3.0.0-canary.150 ### Patch Changes - ai@7.0.0-canary.150 ## @ai-sdk/llamaindex@3.0.0-canary.150 ### Patch Changes - ai@7.0.0-canary.150 ## @ai-sdk/openai@4.0.0-canary.63 ### Patch Changes - 17b5597: fix(openai): skip passing reasoning items when using previous response id ## @ai-sdk/otel@1.0.0-canary.96 ### Patch Changes - ai@7.0.0-canary.150 ## @ai-sdk/react@4.0.0-canary.151 ### Patch Changes - ai@7.0.0-canary.150 ## @ai-sdk/rsc@3.0.0-canary.151 ### Patch Changes - ai@7.0.0-canary.150 ## @ai-sdk/svelte@5.0.0-canary.150 ### Patch Changes - ai@7.0.0-canary.150 ## @ai-sdk/vue@4.0.0-canary.150 ### Patch Changes - ai@7.0.0-canary.150 ## @ai-sdk/workflow@1.0.0-canary.67 ### Patch Changes - ai@7.0.0-canary.150 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
## Summary
- Change `concurrency.group` in `.github/workflows/release.yml` from a
single global `'release'` to `'release-${{ github.ref }}'` so each
release branch (`main`, `release-v6.0`, `release-v5.0`) gets its own
concurrency slot.
## Why
Today all three Release runs share one concurrency group. With
`cancel-in-progress: false`, GitHub queues at most one pending run per
group — so when three pushes arrive in quick succession (as happened
today on #15509, #15513, #15517), the middle pending run gets bumped out
of the queue and canceled. Run
[26246209250](https://github.com/vercel/ai/actions/runs/26246209250) was
canceled this way.
Scoping the group per branch lets each branch's Release workflow run
independently while still serializing runs within a single branch.
## Test plan
- [ ] Mirror change on `release-v6.0` and `release-v5.0` branches
- [ ] Confirm subsequent overlapping pushes across branches no longer
cancel each other
) ## Background Add a 1st-party `@ai-sdk/quiverai` provider for [QuiverAI](https://quiver.ai/) SVG image generation, ported from https://github.com/quiverai/ai-sdk-provider. This PR targets `main` (canary pre-release). It must be merged **after** #15463 has shipped `@ai-sdk/quiverai@1.0.0` from `release-v6.0`. With #15463's `v1.0.0` recorded as the initial version in `.changeset/pre.json`, the major changeset on this branch will publish `@ai-sdk/quiverai@2.0.0` once canary mode exits. ## Summary - New `packages/quiverai` package (image model only) supporting `generate` and `vectorize` operations against Arrow models (`arrow-1`, `arrow-1.1`, `arrow-1.1-max`). - Workflow serialization, example in `examples/ai-functions/src/generate-image/quiverai/`, docs at `content/providers/01-ai-sdk-providers/180-quiverai.mdx`, major changeset. - `package.json` version pinned to `1.0.0` and `.changeset/pre.json` initialVersions seeded with `@ai-sdk/quiverai: 1.0.0` so canary publishes start at `2.0.0-canary.x` and avoid colliding with the `v1.0.0` line shipped from `release-v6.0`. ## Manual Verification Ran both examples added in this PR against the live QuiverAI API: - `examples/ai-functions/src/generate-image/quiverai/basic.ts` — text-to-SVG generation with `arrow-1.1`. - `examples/ai-functions/src/generate-image/quiverai/vectorize.ts` — vectorization of `examples/ai-functions/data/wtf-logo.png` with `arrow-1.1`. ## Checklist - [x] All commits are signed (PRs with unsigned commits cannot be merged) - [x] Tests have been added / updated (for bug fixes / features) - [x] Documentation has been added / updated (for bug fixes / features) - [x] A _patch_ changeset for relevant packages has been added (for bug fixes / features - run `pnpm changeset` in the project root) - [x] I have reviewed this pull request (self-review) ## Related Issues Closes #15459 Depends on #15463 (must merge first). --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ `main` is currently in **pre mode** so this branch has prereleases rather than normal releases. If you want to exit prereleases, run `changeset pre exit` on `main`.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ # Releases ## @ai-sdk/quiverai@2.0.0-canary.0 ### Major Changes - d56c97b: Add `@ai-sdk/quiverai` provider for QuiverAI SVG image generation and vectorization. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…nerateImage` with Gemini (#15522) ## Background `generateText` can ground Gemini calls on Google Search via the `google.tools.googleSearch(...)` tool, but `generateImage` has no `tools` parameter — so there was no way to apply the same grounding when using `generateImage` with Gemini image models. ## Summary Exposes Google Search grounding for `generateImage` through `providerOptions.google.googleSearch`, which the Google image model forwards as the `google.google_search` provider tool on the underlying language-model call (Gemini image generation already routes through the language model API). Grounding info from the response is now merged onto the image result's `providerMetadata.google`. ## Manual Verification Run the new example. ## Checklist - [x] All commits are signed (PRs with unsigned commits cannot be merged) - [x] Tests have been added / updated (for bug fixes / features) - [x] Documentation has been added / updated (for bug fixes / features) - [x] A _patch_ changeset for relevant packages has been added (for bug fixes / features - run `pnpm changeset` in the project root) - [x] I have reviewed this pull request (self-review)
## Background #15465 Before, both 401 paths in the transport independently called `auth()`: - `send()` handles POST /mcp initialize 401. - `openInboundSse()` handles background GET /mcp 401. that meant if one request is already refreshing tokens, any other concurrent 401 recovery would start its own recovery. this could lead to a race condition in the refresh and return invalid auth / force re auth. ## Summary - introduce a new function `authorizeOnce()` that runs a single OAuth recovery flow for concurrent 401 responses ## Manual Verification verified in the reproduction in the unit tests ## Checklist - [x] All commits are signed (PRs with unsigned commits cannot be merged) - [x] Tests have been added / updated (for bug fixes / features) - [ ] Documentation has been added / updated (for bug fixes / features) - [x] A _patch_ changeset for relevant packages has been added (for bug fixes / features - run `pnpm changeset` in the project root) - [x] I have reviewed this pull request (self-review) ## Related Issues fixes #15465
…el (#15525) ## Background reported in #14351 when using the model id `flux-pro-1.0-fill`, the BFL api expects the the field `image` instead of `input_image` this is also logged in their docs in the request sent [here](https://docs.bfl.ml/flux_tools/flux_1_fill#create-a-request) ## Summary change just that field for the mode id `flux-pro-1.0-fill` based on a conditional check ## Manual Verification verified by running the repro: <details> <summary>repro </summary> ```ts import { blackForestLabs, type BlackForestLabsImageModelOptions, } from '@ai-sdk/black-forest-labs'; import { generateImage } from 'ai'; import sharp from 'sharp'; import { run } from '../../lib/run'; import { presentImages } from '../../lib/present-image'; run(async () => { const image = await sharp({ create: { width: 256, height: 256, channels: 3, background: { r: 120, g: 180, b: 255 }, }, }) .png() .toBuffer(); const mask = await sharp({ create: { width: 256, height: 256, channels: 3, background: { r: 255, g: 255, b: 255 }, }, }) .png() .toBuffer(); console.log( 'Running BFL fill inpainting with a 256x256 input image and mask.', ); const result = await generateImage({ model: blackForestLabs.image('flux-pro-1.0-fill'), prompt: { text: 'Replace the masked area with a red square.', images: [image], mask, }, aspectRatio: '1:1', providerOptions: { blackForestLabs: { outputFormat: 'png', steps: 25, guidance: 7.5, } satisfies BlackForestLabsImageModelOptions, }, }); await presentImages(result.images); }); ``` </details> ## Checklist - [x] All commits are signed (PRs with unsigned commits cannot be merged) - [x] Tests have been added / updated (for bug fixes / features) - [ ] Documentation has been added / updated (for bug fixes / features) - [x] A _patch_ changeset for relevant packages has been added (for bug fixes / features - run `pnpm changeset` in the project root) - [x] I have reviewed this pull request (self-review) ## Related Issues fixes #14351
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ `main` is currently in **pre mode** so this branch has prereleases rather than normal releases. If you want to exit prereleases, run `changeset pre exit` on `main`.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ # Releases ## @ai-sdk/black-forest-labs@2.0.0-canary.45 ### Patch Changes - 23b6aca: fix(bfl): use 'image' field instead of 'input_image' for fill pro model ## @ai-sdk/google@4.0.0-canary.72 ### Patch Changes - b71c0d7: feat(provider/google): support Google search grounding when using `generateImage` with Gemini ## @ai-sdk/google-vertex@5.0.0-canary.91 ### Patch Changes - Updated dependencies [b71c0d7] - @ai-sdk/google@4.0.0-canary.72 ## @ai-sdk/mcp@2.0.0-canary.53 ### Patch Changes - 6c17a9f: fix(mcp): deduplicate auth refresh on http transport ## @ai-sdk/react@4.0.0-canary.152 ### Patch Changes - Updated dependencies [6c17a9f] - @ai-sdk/mcp@2.0.0-canary.53 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
## Background The Google provider `README.md` inside the `packages` folder contained a documentation link that points to a non-existent page on `ai-sdk.dev`. The broken link was: https://ai-sdk.dev/docs/reference/stream-helpers/google-generative-ai-stream This currently redirects to a 404 page. The correct documentation page is: https://ai-sdk.dev/providers/ai-sdk-providers/google-generative-ai ## Summary Updated both occurrences of the broken Google provider documentation link in the README file. The links now point to the correct Google Generative AI provider documentation page: https://ai-sdk.dev/providers/ai-sdk-providers/google-generative-ai ## Checklist - [x] All commits are signed (PRs with unsigned commits cannot be merged) - [ ] Tests have been added / updated (for bug fixes / features) - [x] Documentation has been added / updated (for bug fixes / features) - [ ] A _patch_ changeset for relevant packages has been added (for bug fixes / features - run `pnpm changeset` in the project root) - [x] I have reviewed this pull request (self-review) ## Related Issues Fixes #15541
## Background Currently if web search returns an error, we mishandled it and lose the tool response when continuing the conversation. This would result in errors like: ``` Error: messages.1: `web_search` tool use with id `srvtoolu_01DZi3ZdTUsKUj24ZhA1XdSV` was found without a corresponding `web_search_tool_result` block ``` ## Summary web fetch already has handling for this, so reuse that. ## Manual Verification I verified that trying to continue a conversation with an error failed on the old version and works with this one. ## Checklist - [x] All commits are signed (PRs with unsigned commits cannot be merged) - [x] Tests have been added / updated (for bug fixes / features) - [ ] Documentation has been added / updated (for bug fixes / features) - [x] A _patch_ changeset for relevant packages has been added (for bug fixes / features - run `pnpm changeset` in the project root) - [x] I have reviewed this pull request (self-review)
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ `main` is currently in **pre mode** so this branch has prereleases rather than normal releases. If you want to exit prereleases, run `changeset pre exit` on `main`.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ # Releases ## @ai-sdk/amazon-bedrock@5.0.0-canary.68 ### Patch Changes - Updated dependencies [acdbf84] - @ai-sdk/anthropic@4.0.0-canary.58 ## @ai-sdk/anthropic@4.0.0-canary.58 ### Patch Changes - acdbf84: Handle errors from anthropic websearch tool ## @ai-sdk/google-vertex@5.0.0-canary.92 ### Patch Changes - Updated dependencies [acdbf84] - @ai-sdk/anthropic@4.0.0-canary.58 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
## Background
Vercel AI Gateway needs SDK support for scoping requests made with
Vercel access credentials. Vercel app access tokens (`vca_...`) and
personal access tokens (`vcp_...`) can already be sent as bearer
credentials through the existing `apiKey` option, but multi-team
credentials need a way to specify the target team.
## Summary
Adds optional team scoping to the Gateway provider:
```ts
const gateway = createGateway({
apiKey: 'vca_...',
teamIdOrSlug: 'vercel',
});
```
This PR does **not** add a new credential option. The existing `apiKey`
option remains the single explicit bearer credential field and can be
used with:
- AI Gateway API keys
- Vercel app access tokens (`vca_...`)
- Vercel personal access tokens (`vcp_...`)
When `teamIdOrSlug` is provided, the SDK sends:
```http
x-vercel-ai-gateway-team: <teamIdOrSlug>
```
No new environment variable is introduced, and no new
`ai-gateway-auth-method` value is introduced.
Credential precedence remains:
```txt
apiKey > AI_GATEWAY_API_KEY > OIDC
```
## Manual Verification
Automated validation run:
```bash
pnpm --filter @ai-sdk/gateway type-check
pnpm --filter @ai-sdk/gateway test:node
pnpm --filter @ai-sdk/gateway test:edge
git diff --check
```
Gateway tests pass:
```txt
428 passed
```
`pnpm type-check:full` was also attempted earlier, but failed on
existing unrelated missing-module errors in other packages/examples.
## Checklist
- [x] All commits are signed (PRs with unsigned commits cannot be
merged)
- [x] Tests have been added / updated (for bug fixes / features)
- [x] Documentation has been added / updated (for bug fixes / features)
- [x] A _patch_ changeset for relevant packages has been added (for bug
fixes / features - run `pnpm changeset` in the project root)
- [x] I have reviewed this pull request (self-review)
## Future Work
## Related Issues
N/A
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ `main` is currently in **pre mode** so this branch has prereleases rather than normal releases. If you want to exit prereleases, run `changeset pre exit` on `main`.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ # Releases ## ai@7.0.0-canary.151 ### Patch Changes - Updated dependencies [8b811d8] - @ai-sdk/gateway@4.0.0-canary.90 ## @ai-sdk/angular@3.0.0-canary.151 ### Patch Changes - ai@7.0.0-canary.151 ## @ai-sdk/gateway@4.0.0-canary.90 ### Patch Changes - 8b811d8: feat(provider/gateway): add optional Vercel team scoping for Gateway authentication. The existing `apiKey` option can be used with AI Gateway API keys, Vercel personal access tokens, and Vercel app access tokens. ## @ai-sdk/langchain@3.0.0-canary.151 ### Patch Changes - ai@7.0.0-canary.151 ## @ai-sdk/llamaindex@3.0.0-canary.151 ### Patch Changes - ai@7.0.0-canary.151 ## @ai-sdk/otel@1.0.0-canary.97 ### Patch Changes - ai@7.0.0-canary.151 ## @ai-sdk/react@4.0.0-canary.153 ### Patch Changes - ai@7.0.0-canary.151 ## @ai-sdk/rsc@3.0.0-canary.152 ### Patch Changes - ai@7.0.0-canary.151 ## @ai-sdk/svelte@5.0.0-canary.151 ### Patch Changes - ai@7.0.0-canary.151 ## @ai-sdk/vue@4.0.0-canary.151 ### Patch Changes - ai@7.0.0-canary.151 ## @ai-sdk/workflow@1.0.0-canary.68 ### Patch Changes - ai@7.0.0-canary.151 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
## Summary Adds a unified `serviceTier: 'flex' | 'priority'` option to `GatewayProviderOptions`. The AI Gateway translates this into whichever per-provider option each provider expects. If the user also set a per-provider tier directly, the gateway value overrides it. --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ `main` is currently in **pre mode** so this branch has prereleases rather than normal releases. If you want to exit prereleases, run `changeset pre exit` on `main`.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ # Releases ## ai@7.0.0-canary.152 ### Patch Changes - Updated dependencies [d4d4a5e] - @ai-sdk/gateway@4.0.0-canary.91 ## @ai-sdk/angular@3.0.0-canary.152 ### Patch Changes - ai@7.0.0-canary.152 ## @ai-sdk/gateway@4.0.0-canary.91 ### Patch Changes - d4d4a5e: Add `serviceTier: 'flex' | 'priority'` to `GatewayProviderOptions`. ## @ai-sdk/langchain@3.0.0-canary.152 ### Patch Changes - ai@7.0.0-canary.152 ## @ai-sdk/llamaindex@3.0.0-canary.152 ### Patch Changes - ai@7.0.0-canary.152 ## @ai-sdk/otel@1.0.0-canary.98 ### Patch Changes - ai@7.0.0-canary.152 ## @ai-sdk/react@4.0.0-canary.154 ### Patch Changes - ai@7.0.0-canary.152 ## @ai-sdk/rsc@3.0.0-canary.153 ### Patch Changes - ai@7.0.0-canary.152 ## @ai-sdk/svelte@5.0.0-canary.152 ### Patch Changes - ai@7.0.0-canary.152 ## @ai-sdk/vue@4.0.0-canary.152 ### Patch Changes - ai@7.0.0-canary.152 ## @ai-sdk/workflow@1.0.0-canary.69 ### Patch Changes - ai@7.0.0-canary.152 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…ecution` tool dynamic calls from latest `web_fetch` or `web_search` (#15566) ## Background When Anthropic's `web_fetch` or `web_search` tools internally trigger code execution, the API emits `code_execution` tool calls even though the user did not register that tool. The fix from #12668 marked such calls as `dynamic: true` to bypass validation, but several code paths in the Anthropic language model still emitted unmarked calls, causing errors. The newer `code_execution_20250825` tool variant also surfaces calls under sub-names (`bash_code_execution`, `text_editor_code_execution`) that need the same treatment. ## Summary - Mark `code_execution` tool calls as `dynamic` in all remaining emission sites for the 20250825 tool variant (non-streaming `bash_code_execution`/`text_editor_code_execution` branch, streaming first-delta and end paths, and streaming `tool-call` finalization). - Normalize the streaming delta path to use the unified `code_execution` provider tool name and consistently backfill input with `"type": "programmatic-tool-call"` so downstream consumers see a consistent shape. - Only set `firstDelta: true` when no input has been buffered yet, avoiding double-prefixing. This was not surfacing in a real bug so far, but it was clearly also an oversight (per `firstDelta: true` only ever being okay if there was no input yet on that same chunk). ## Manual Verification Run the existing examples: - `examples/ai-functions/src/stream-text/anthropic/web-fetch-20260209-pdf.ts` - `examples/ai-functions/src/stream-text/anthropic/web-fetch-20260209-pdf.ts` Without this PR, they will somewhere in the stream include the error about an incompatible tool being found, most times when executing them. With this PR, this error is gone from both. ## Checklist - [x] All commits are signed (PRs with unsigned commits cannot be merged) - [ ] Tests have been added / updated (for bug fixes / features) - [ ] Documentation has been added / updated (for bug fixes / features) - [x] A _patch_ changeset for relevant packages has been added (for bug fixes / features - run `pnpm changeset` in the project root) - [x] I have reviewed this pull request (self-review)
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ `main` is currently in **pre mode** so this branch has prereleases rather than normal releases. If you want to exit prereleases, run `changeset pre exit` on `main`.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ # Releases ## @ai-sdk/anthropic-aws@1.0.0-canary.0 ### Major Changes - e617cba: feat(anthropic-aws): add Claude Platform on AWS provider ### Patch Changes - Updated dependencies [648705c] - @ai-sdk/anthropic@4.0.0-canary.59 ## @ai-sdk/amazon-bedrock@5.0.0-canary.69 ### Patch Changes - Updated dependencies [648705c] - @ai-sdk/anthropic@4.0.0-canary.59 ## @ai-sdk/anthropic@4.0.0-canary.59 ### Patch Changes - 648705c: fix(provider/anthropic): fix remaining errors with Anthropic `code_execution` tool dynamic calls from latest `web_fetch` or `web_search` ## @ai-sdk/google-vertex@5.0.0-canary.93 ### Patch Changes - Updated dependencies [648705c] - @ai-sdk/anthropic@4.0.0-canary.59 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…hunks (#15464) ## Background Some OpenAI-compatible providers (e.g. zhipu/glm-5) send an empty string `""` for `delta.role` in streaming chunks instead of `"assistant"` or omitting it. The strict `z.enum(['assistant']).nullish()` validation in `chunkBaseSchema` rejects this value, causing `AI_TypeValidationError` / `ZodError` and breaking the entire stream. Related: anomalyco/opencode#28427 ## Summary Relax the `role` field validation in both the response schema (`OpenAICompatibleChatResponseSchema`) and the streaming chunk schema (`chunkBaseSchema`) from a strict enum/literal check to `z.string().nullish()`. The `role` field is not consumed by the implementation — it exists only for schema validation — so accepting any string value (including empty string) is safe and matches the provider-agnostic intent of the `openai-compatible` adapter. ### Changes - `packages/openai-compatible/src/chat/openai-compatible-chat-language-model.ts`: Change `role` validation from `z.literal('assistant').nullish()` / `z.enum(['assistant']).nullish()` to `z.string().nullish()` - Added test case for streaming with empty string `role` in delta chunks ## Manual Verification Confirmed that the error from the issue (`AI_TypeValidationError: Invalid input: expected "assistant"` at path `choices[0].delta.role`) is caused by the strict enum validation rejecting `role: ""`. After the fix, chunks with `role: ""` parse successfully and text content is extracted correctly. ## Checklist - [x] Tests have been added / updated (for bug fixes / features) - [ ] Documentation has been added / updated (for bug fixes / features) - [x] A _patch_ changeset for relevant packages has been added (for bug fixes / features - run `pnpm changeset` in the project root) - [x] I have reviewed this pull request (self-review) --- 🤖 **Disclosure:** This PR was authored by [Kagura](https://github.com/kagura-agent), an AI agent. Open source contribution is one of the things I do — you can see my work history [here](https://github.com/kagura-agent/github-contribution). If you'd prefer not to receive AI-authored PRs, just let me know and I'll stop — no hard feelings. --------- Co-authored-by: Aayush Kapoor <83492835+aayush-kapoor@users.noreply.github.com>
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.
Background
Summary
Manual Verification
Checklist
pnpm changesetin the project root)pnpm prettier-fixin the project root)Future Work
Related Issues