Open
Conversation
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. # Releases ## ai@6.0.103 ### Patch Changes - Updated dependencies [ba63bc2] - @ai-sdk/gateway@3.0.57 ## @ai-sdk/angular@2.0.104 ### Patch Changes - ai@6.0.103 ## @ai-sdk/gateway@3.0.57 ### Patch Changes - ba63bc2: chore(provider/gateway): update gateway model settings files ## @ai-sdk/langchain@2.0.109 ### Patch Changes - ai@6.0.103 ## @ai-sdk/llamaindex@2.0.103 ### Patch Changes - ai@6.0.103 ## @ai-sdk/react@3.0.105 ### Patch Changes - ai@6.0.103 ## @ai-sdk/rsc@2.0.103 ### Patch Changes - ai@6.0.103 ## @ai-sdk/svelte@4.0.103 ### Patch Changes - ai@6.0.103 ## @ai-sdk/vue@3.0.103 ### Patch Changes - ai@6.0.103 Co-authored-by: vercel-ai-sdk[bot] <225926702+vercel-ai-sdk[bot]@users.noreply.github.com>
## Background #12766 we were not passing the `strict: true` mode for tools for the bedrock and groq provider, which sometimes led to the models not adhering to the tool input schema ## Summary modified the api to ensure strict mode is stored and ensure it's passed to the model tool spec ## Manual Verification hard to verify via a cli example since behaviour can vary but ran the following example <Details> <summary> repro example </summary> ```ts import { generateText, tool } from 'ai'; import { bedrock } from '@ai-sdk/amazon-bedrock'; import { z } from 'zod'; import { run } from '../../lib/run'; run(async () => { const result = await generateText({ model: bedrock('openai.gpt-oss-120b-1:0'), tools: { getWeather: tool({ description: 'Get weather by city and unit', inputSchema: z.object({ city: z.string(), unit: z.enum(['celsius', 'fahrenheit']), }), strict: true, }), }, prompt: 'What is the weather in Boston?', }); console.log(JSON.stringify(result, null, 2)); }); ``` </Details> ## 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) ## Related Issues fixes #12766
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. # Releases ## @ai-sdk/amazon-bedrock@4.0.66 ### Patch Changes - 91f8777: fix(bedrock/groq): pass strict mode for tools ## @ai-sdk/groq@3.0.25 ### Patch Changes - 91f8777: fix(bedrock/groq): pass strict mode for tools Co-authored-by: vercel-ai-sdk[bot] <225926702+vercel-ai-sdk[bot]@users.noreply.github.com>
…ratios and sizes (#12897) ## Background With the launch of Gemini 3.1 Image, a few new image aspect ratios and one new size were introduced. Reference from the source: googleapis/python-genai@8b2a4e0 ## Summary Adds the new image aspect ratios. ## Manual Verification Run the updated example. ## Checklist - [ ] 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) ## Future Work N/A ## 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. # Releases ## @ai-sdk/google@3.0.33 ### Patch Changes - 1ece97a: feat(provider/google): add support for new Google image model aspect ratios and sizes ## @ai-sdk/google-vertex@4.0.65 ### Patch Changes - Updated dependencies [1ece97a] - @ai-sdk/google@3.0.33 Co-authored-by: vercel-ai-sdk[bot] <225926702+vercel-ai-sdk[bot]@users.noreply.github.com>
…12901) ## Summary Fixes #12770 Azure AI Foundry and Mistral models deployed on Azure omit the `type` field in streaming `tool_calls` deltas. The OpenAI chat stream parser was throwing: ``` InvalidResponseDataError: Expected 'function' type. ``` ## Root Cause In `openai-chat-language-model.ts`, the parser checked `if (toolCallDelta.type !== 'function')` at the start of a new tool call. Azure / Mistral omit the `type` field entirely (it is `undefined`), so `undefined !== 'function'` triggered the error before even reading the function name or id. ## Fix Changed the guard from: ```ts if (toolCallDelta.type !== 'function') { ``` to: ```ts if (toolCallDelta.type != null && toolCallDelta.type !== 'function') { ``` A missing `type` is now silently treated as `"function"` (the only valid value). An explicit non-`"function"` type still throws. ## Test Added a new streaming test case that sends tool call deltas without a `type` field (matching Azure / Mistral behaviour) and verifies the tool call is parsed correctly. Co-authored-by: sleitor <sleitor@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. # Releases ## @ai-sdk/azure@3.0.37 ### Patch Changes - Updated dependencies [53bdfa5] - @ai-sdk/openai@3.0.36 ## @ai-sdk/openai@3.0.36 ### Patch Changes - 53bdfa5: fix(openai): allow null/undefined type in streaming tool call deltas Azure AI Foundry and Mistral deployed on Azure omit the `type` field in streaming tool_calls deltas. The chat stream parser now accepts a missing `type` field (treating it as `"function"`) instead of throwing `InvalidResponseDataError: Expected 'function' type.` Fixes #12770 Co-authored-by: vercel-ai-sdk[bot] <225926702+vercel-ai-sdk[bot]@users.noreply.github.com>
## Background #12794 anthropic silently released a new code execution tool (which is suggested for programmatic tool calling) ref here: https://platform.claude.com/docs/en/agents-and-tools/tool-use/programmatic-tool-calling ## Summary adds the new tool to the registry, updates the api schema, makes sure the the conversion from prompts to responses is correctly mapped ## Manual Verification verified by running the examples - `examples/ai-functions/src/generate-text/anthropic/code-execution-20260120.ts` - `examples/ai-functions/src/stream-text/anthropic/code-execution-20260120.ts` - `examples/ai-functions/src/generate-text/anthropic/programmatic-tool-calling.ts` - `http://localhost:3000/chat/anthropic-programmatic-tool-calling` ## Checklist - [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 fixe #12794
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. # Releases ## @ai-sdk/amazon-bedrock@4.0.67 ### Patch Changes - Updated dependencies [2164cdf] - @ai-sdk/anthropic@3.0.48 ## @ai-sdk/anthropic@3.0.48 ### Patch Changes - 2164cdf: feat(anthropic): add the new code_execution tool ## @ai-sdk/google-vertex@4.0.66 ### Patch Changes - Updated dependencies [2164cdf] - @ai-sdk/anthropic@3.0.48 Co-authored-by: vercel-ai-sdk[bot] <225926702+vercel-ai-sdk[bot]@users.noreply.github.com>
…g.format (#12319) ## Background #12298 ## Summary - **`@ai-sdk/anthropic`**: Migrated the deprecated `output_format` request parameter to `output_config.format`, aligning with the [current Anthropic API](https://platform.claude.com/docs/en/build-with-claude/structured-outputs). The `effort` and `format` fields are now merged into a single `output_config` object to avoid one spread overwriting the other. - **`@ai-sdk/amazon-bedrock`**: Enabled `supportsNativeStructuredOutput: true` for Bedrock Anthropic models. Structured outputs are now GA on Bedrock and no longer require a beta header, so the JSON tool fallback is no longer necessary. ## Manual Verification verified the fix by running the following code snippet before and after the changes <Details> <summary> repro </summary> ```ts import { bedrockAnthropic } from '@ai-sdk/amazon-bedrock/anthropic'; import { generateText, Output } from 'ai'; import 'dotenv/config'; import { z } from 'zod'; import { run } from '../../lib/run'; run(async () => { const result = await generateText({ model: bedrockAnthropic('us.anthropic.claude-opus-4-6-v1'), output: Output.object({ schema: z.object({ recipe: z.object({ name: z.string(), ingredients: z.array( z.object({ name: z.string(), amount: z.string(), }), ), steps: z.array(z.string()), }), }), }), providerOptions: { anthropic: { structuredOutputMode: "outputFormat", thinking: { type: "adaptive" }, effort: "low", }, }, prompt: 'Generate a lasagna recipe.', }); console.log('Recipe:', JSON.stringify(result.output, null, 2)); console.log(); console.log('Finish reason:', result.finishReason); console.log('Usage:', result.usage); }); ``` </Details> ## Related Issues Fixes #12298 --------- Co-authored-by: Aayush Kapoor <83492835+aayush-kapoor@users.noreply.github.com> Co-authored-by: Aayush Kapoor <aayushkapoor34@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. # Releases ## @ai-sdk/amazon-bedrock@4.0.68 ### Patch Changes - d98d9ba: Migrated deprecated `output_format` parameter to `output_config.format` for structured outputs + Enabled native structured output support for Bedrock Anthropic models via `output_config.format`. - Updated dependencies [d98d9ba] - @ai-sdk/anthropic@3.0.49 ## @ai-sdk/anthropic@3.0.49 ### Patch Changes - d98d9ba: Migrated deprecated `output_format` parameter to `output_config.format` for structured outputs + Enabled native structured output support for Bedrock Anthropic models via `output_config.format`. ## @ai-sdk/google-vertex@4.0.67 ### Patch Changes - Updated dependencies [d98d9ba] - @ai-sdk/anthropic@3.0.49 Co-authored-by: vercel-ai-sdk[bot] <225926702+vercel-ai-sdk[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. # Releases ## ai@6.0.104 ### Patch Changes - Updated dependencies [1330f2f] - @ai-sdk/gateway@3.0.58 ## @ai-sdk/angular@2.0.105 ### Patch Changes - ai@6.0.104 ## @ai-sdk/gateway@3.0.58 ### Patch Changes - 1330f2f: chore(provider/gateway): update gateway model settings files ## @ai-sdk/langchain@2.0.110 ### Patch Changes - ai@6.0.104 ## @ai-sdk/llamaindex@2.0.104 ### Patch Changes - ai@6.0.104 ## @ai-sdk/react@3.0.106 ### Patch Changes - ai@6.0.104 ## @ai-sdk/rsc@2.0.104 ### Patch Changes - ai@6.0.104 ## @ai-sdk/svelte@4.0.104 ### Patch Changes - ai@6.0.104 ## @ai-sdk/vue@3.0.104 ### Patch Changes - ai@6.0.104 Co-authored-by: vercel-ai-sdk[bot] <225926702+vercel-ai-sdk[bot]@users.noreply.github.com>
## background adds support for openai custom tools in responses and fixes alias mapping failures that could cause runtime errors refs https://developers.openai.com/api/reference/resources/responses/methods/create/ ## summary - add custom tool support for responses with grammar formats - resolve aliased custom tool names end to end across tool choice, parsing, and streaming - map provider tool names back to sdk tool keys so tool calls return the user-facing key - support custom tool output content mapping instead of dropping to empty output - add repro examples for forced and unforced alias flows ## before this fix - forced alias tool choice could fail with api call errors because custom tools were resolved as function tool choice - unforced alias calls could fail with no such tool errors when provider name and sdk key differed ## after this fix - forced alias tool choice resolves to `{ type: 'custom', name: 'write_sql' }` and executes correctly - returned tool call and tool result names stay as sdk key `alias_name` - unforced runs no longer fail due to alias mismatch and may validly return no tool calls when model answers directly ## repro <details> <summary>repro-alias-forced</summary> ### before fix (`368bbdd468`) ```bash git checkout 368bbdd cd examples/ai-functions pnpm tsx src/generate-text/openai/repro-alias-forced.ts ``` result - `AI_APICallError: Tool choice 'function' not found in 'tools' parameter` - request body includes `tool_choice: { type: 'function', name: 'alias_name' }` ### after fix (`a3565b08c2`) ```bash git checkout a3565b0 cd examples/ai-functions pnpm tsx src/generate-text/openai/repro-alias-forced.ts ``` result - succeeds with tool execution - tool call and tool result use sdk key `alias_name` - `Steps: 2` </details> <details> <summary>repro-alias-unforced</summary> ### before fix (`368bbdd468`) ```bash git checkout 368bbdd cd examples/ai-functions pnpm tsx src/generate-text/openai/repro-alias-unforced.ts ``` observed behavior (multiple runs) - run 1: direct text response, `toolCalls: []` - run 2: `AI_NoSuchToolError` when model emits `write_sql` but available tool key is `alias_name` - run 3: direct text response, `toolCalls: []` ### after fix (`a3565b08c2`) ```bash git checkout a3565b0 cd examples/ai-functions pnpm tsx src/generate-text/openai/repro-alias-unforced.ts ``` observed behavior (multiple runs) - no alias mismatch errors - direct text responses with `toolCalls: []`, `toolResults: []`, `Steps: 2` </details> ## verification - `pnpm tsx src/generate-text/openai/responses-custom-tool.ts` - `pnpm tsx src/stream-text/openai/responses-custom-tool.ts` - `pnpm tsx src/generate-text/openai/responses-custom-tool-multi-turn.ts` - `pnpm tsx src/stream-text/openai/responses-custom-tool-multi-turn.ts` ## checklist - [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 (run `pnpm changeset` in root) - [x] i have reviewed this pull request (self-review) ## related issues fixes #12614 --------- Co-authored-by: dancer <josh@afterima.ge>
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. # Releases ## ai@6.0.105 ### Patch Changes - Updated dependencies [58bc42d] - @ai-sdk/provider-utils@4.0.16 - @ai-sdk/gateway@3.0.59 ## @ai-sdk/alibaba@1.0.6 ### Patch Changes - Updated dependencies [58bc42d] - @ai-sdk/provider-utils@4.0.16 - @ai-sdk/openai-compatible@2.0.31 ## @ai-sdk/amazon-bedrock@4.0.69 ### Patch Changes - Updated dependencies [58bc42d] - @ai-sdk/provider-utils@4.0.16 - @ai-sdk/anthropic@3.0.50 ## @ai-sdk/angular@2.0.106 ### Patch Changes - Updated dependencies [58bc42d] - @ai-sdk/provider-utils@4.0.16 - ai@6.0.105 ## @ai-sdk/anthropic@3.0.50 ### Patch Changes - Updated dependencies [58bc42d] - @ai-sdk/provider-utils@4.0.16 ## @ai-sdk/assemblyai@2.0.21 ### Patch Changes - Updated dependencies [58bc42d] - @ai-sdk/provider-utils@4.0.16 ## @ai-sdk/azure@3.0.38 ### Patch Changes - Updated dependencies [58bc42d] - @ai-sdk/openai@3.0.37 - @ai-sdk/provider-utils@4.0.16 ## @ai-sdk/baseten@1.0.34 ### Patch Changes - Updated dependencies [58bc42d] - @ai-sdk/provider-utils@4.0.16 - @ai-sdk/openai-compatible@2.0.31 ## @ai-sdk/black-forest-labs@1.0.21 ### Patch Changes - Updated dependencies [58bc42d] - @ai-sdk/provider-utils@4.0.16 ## @ai-sdk/bytedance@1.0.1 ### Patch Changes - Updated dependencies [58bc42d] - @ai-sdk/provider-utils@4.0.16 ## @ai-sdk/cerebras@2.0.35 ### Patch Changes - Updated dependencies [58bc42d] - @ai-sdk/provider-utils@4.0.16 - @ai-sdk/openai-compatible@2.0.31 ## @ai-sdk/cohere@3.0.22 ### Patch Changes - Updated dependencies [58bc42d] - @ai-sdk/provider-utils@4.0.16 ## @ai-sdk/deepgram@2.0.21 ### Patch Changes - Updated dependencies [58bc42d] - @ai-sdk/provider-utils@4.0.16 ## @ai-sdk/deepinfra@2.0.35 ### Patch Changes - Updated dependencies [58bc42d] - @ai-sdk/provider-utils@4.0.16 - @ai-sdk/openai-compatible@2.0.31 ## @ai-sdk/deepseek@2.0.21 ### Patch Changes - Updated dependencies [58bc42d] - @ai-sdk/provider-utils@4.0.16 ## @ai-sdk/elevenlabs@2.0.21 ### Patch Changes - Updated dependencies [58bc42d] - @ai-sdk/provider-utils@4.0.16 ## @ai-sdk/fal@2.0.22 ### Patch Changes - Updated dependencies [58bc42d] - @ai-sdk/provider-utils@4.0.16 ## @ai-sdk/fireworks@2.0.36 ### Patch Changes - Updated dependencies [58bc42d] - @ai-sdk/provider-utils@4.0.16 - @ai-sdk/openai-compatible@2.0.31 ## @ai-sdk/gateway@3.0.59 ### Patch Changes - Updated dependencies [58bc42d] - @ai-sdk/provider-utils@4.0.16 ## @ai-sdk/gladia@2.0.21 ### Patch Changes - Updated dependencies [58bc42d] - @ai-sdk/provider-utils@4.0.16 ## @ai-sdk/google@3.0.34 ### Patch Changes - Updated dependencies [58bc42d] - @ai-sdk/provider-utils@4.0.16 ## @ai-sdk/google-vertex@4.0.68 ### Patch Changes - Updated dependencies [58bc42d] - @ai-sdk/provider-utils@4.0.16 - @ai-sdk/anthropic@3.0.50 - @ai-sdk/google@3.0.34 ## @ai-sdk/groq@3.0.26 ### Patch Changes - Updated dependencies [58bc42d] - @ai-sdk/provider-utils@4.0.16 ## @ai-sdk/huggingface@1.0.33 ### Patch Changes - Updated dependencies [58bc42d] - @ai-sdk/provider-utils@4.0.16 - @ai-sdk/openai-compatible@2.0.31 ## @ai-sdk/hume@2.0.21 ### Patch Changes - Updated dependencies [58bc42d] - @ai-sdk/provider-utils@4.0.16 ## @ai-sdk/klingai@3.0.5 ### Patch Changes - Updated dependencies [58bc42d] - @ai-sdk/provider-utils@4.0.16 ## @ai-sdk/langchain@2.0.111 ### Patch Changes - ai@6.0.105 ## @ai-sdk/llamaindex@2.0.105 ### Patch Changes - ai@6.0.105 ## @ai-sdk/lmnt@2.0.21 ### Patch Changes - Updated dependencies [58bc42d] - @ai-sdk/provider-utils@4.0.16 ## @ai-sdk/luma@2.0.21 ### Patch Changes - Updated dependencies [58bc42d] - @ai-sdk/provider-utils@4.0.16 ## @ai-sdk/mcp@1.0.22 ### Patch Changes - Updated dependencies [58bc42d] - @ai-sdk/provider-utils@4.0.16 ## @ai-sdk/mistral@3.0.21 ### Patch Changes - Updated dependencies [58bc42d] - @ai-sdk/provider-utils@4.0.16 ## @ai-sdk/moonshotai@2.0.6 ### Patch Changes - Updated dependencies [58bc42d] - @ai-sdk/provider-utils@4.0.16 - @ai-sdk/openai-compatible@2.0.31 ## @ai-sdk/open-responses@1.0.3 ### Patch Changes - Updated dependencies [58bc42d] - @ai-sdk/provider-utils@4.0.16 ## @ai-sdk/openai@3.0.37 ### Patch Changes - 58bc42d: feat(provider/openai): support custom tools with alias mapping - Updated dependencies [58bc42d] - @ai-sdk/provider-utils@4.0.16 ## @ai-sdk/openai-compatible@2.0.31 ### Patch Changes - Updated dependencies [58bc42d] - @ai-sdk/provider-utils@4.0.16 ## @ai-sdk/perplexity@3.0.20 ### Patch Changes - Updated dependencies [58bc42d] - @ai-sdk/provider-utils@4.0.16 ## @ai-sdk/prodia@1.0.18 ### Patch Changes - Updated dependencies [58bc42d] - @ai-sdk/provider-utils@4.0.16 ## @ai-sdk/provider-utils@4.0.16 ### Patch Changes - 58bc42d: feat(provider/openai): support custom tools with alias mapping ## @ai-sdk/react@3.0.107 ### Patch Changes - Updated dependencies [58bc42d] - @ai-sdk/provider-utils@4.0.16 - ai@6.0.105 ## @ai-sdk/replicate@2.0.21 ### Patch Changes - Updated dependencies [58bc42d] - @ai-sdk/provider-utils@4.0.16 ## @ai-sdk/revai@2.0.21 ### Patch Changes - Updated dependencies [58bc42d] - @ai-sdk/provider-utils@4.0.16 ## @ai-sdk/rsc@2.0.105 ### Patch Changes - Updated dependencies [58bc42d] - @ai-sdk/provider-utils@4.0.16 - ai@6.0.105 ## @ai-sdk/svelte@4.0.105 ### Patch Changes - Updated dependencies [58bc42d] - @ai-sdk/provider-utils@4.0.16 - ai@6.0.105 ## @ai-sdk/togetherai@2.0.35 ### Patch Changes - Updated dependencies [58bc42d] - @ai-sdk/provider-utils@4.0.16 - @ai-sdk/openai-compatible@2.0.31 ## @ai-sdk/valibot@2.0.17 ### Patch Changes - Updated dependencies [58bc42d] - @ai-sdk/provider-utils@4.0.16 ## @ai-sdk/vercel@2.0.33 ### Patch Changes - Updated dependencies [58bc42d] - @ai-sdk/provider-utils@4.0.16 - @ai-sdk/openai-compatible@2.0.31 ## @ai-sdk/vue@3.0.105 ### Patch Changes - Updated dependencies [58bc42d] - @ai-sdk/provider-utils@4.0.16 - ai@6.0.105 ## @ai-sdk/xai@3.0.60 ### Patch Changes - Updated dependencies [58bc42d] - @ai-sdk/provider-utils@4.0.16 - @ai-sdk/openai-compatible@2.0.31 Co-authored-by: vercel-ai-sdk[bot] <225926702+vercel-ai-sdk[bot]@users.noreply.github.com>
… responses (#12934) ## background xai supports `logprobs` and `top_logprobs` in both chat and responses requests `@ai-sdk/xai` did not expose these options in provider options ## summary - add `logprobs` and `topLogprobs` to xai chat provider options - add `logprobs` and `topLogprobs` to xai responses provider options - map `providerOptions.xai.logprobs` and `providerOptions.xai.topLogprobs` to request fields `logprobs` and `top_logprobs` - auto-enable `logprobs` when `topLogprobs` is set - add test coverage for chat and responses request forwarding - update xai chat snapshots for new request fields - add ai-functions examples for logprobs in stream-text and generate-text - switch generate-text example to `xai.responses('grok-4-latest')` so the examples cover both chat and responses - document `logprobs` and `topLogprobs` in xai chat and responses provider options docs ## manual verification - `cd examples/ai-functions && pnpm tsx src/generate-text/xai/logprobs.ts` - `cd examples/ai-functions && pnpm tsx src/stream-text/xai/logprobs.ts` ## checklist - [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 related #12825 related #12826 related #12827
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. # Releases ## @ai-sdk/xai@3.0.61 ### Patch Changes - 2e00e03: add support for `logprobs` and `topLogprobs` in xai chat and responses provider options Co-authored-by: vercel-ai-sdk[bot] <225926702+vercel-ai-sdk[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. # Releases ## ai@6.0.106 ### Patch Changes - Updated dependencies [29e9f4d] - @ai-sdk/gateway@3.0.60 ## @ai-sdk/angular@2.0.107 ### Patch Changes - ai@6.0.106 ## @ai-sdk/gateway@3.0.60 ### Patch Changes - 29e9f4d: chore(provider/gateway): update gateway model settings files ## @ai-sdk/langchain@2.0.112 ### Patch Changes - ai@6.0.106 ## @ai-sdk/llamaindex@2.0.106 ### Patch Changes - ai@6.0.106 ## @ai-sdk/react@3.0.108 ### Patch Changes - ai@6.0.106 ## @ai-sdk/rsc@2.0.106 ### Patch Changes - ai@6.0.106 ## @ai-sdk/svelte@4.0.106 ### Patch Changes - ai@6.0.106 ## @ai-sdk/vue@3.0.106 ### Patch Changes - ai@6.0.106 Co-authored-by: vercel-ai-sdk[bot] <225926702+vercel-ai-sdk[bot]@users.noreply.github.com>
…12923) ## Background Follow up to: - #12807 - #12808 - #12809 - #12810 These issues were opened with type "New provider", so models listed in "New models" in this context does not mean these are new models, but rather that they are _all_ models that the provider API supports. This PR removes any models that were not in this list but still in our codebase. ## Summary - Removes obsolete model IDs across the four providers, being conservative to err on the side of keeping one if it _might_ still work: - e.g. aliases (model version that lacks the date suffix of a model that's still supported, model version of a supported model that appends "-latest") - model IDs that are deemed obsolete here but may be present on other providers (e.g. Gateway, Amazon Bedrock, Google Vertex) remain untouched there - Replaces usage in our examples with suitable newer replacement models - Replaces usage in documentation code snippets and removes mentions in documentation model lists or model tables ## 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] 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)
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. # Releases ## @ai-sdk/amazon-bedrock@4.0.70 ### Patch Changes - Updated dependencies [64a8fae] - @ai-sdk/anthropic@3.0.51 ## @ai-sdk/anthropic@3.0.51 ### Patch Changes - 64a8fae: chore: remove obsolete model IDs for Anthropic, Google, OpenAI, xAI ## @ai-sdk/azure@3.0.39 ### Patch Changes - Updated dependencies [64a8fae] - @ai-sdk/openai@3.0.38 ## @ai-sdk/google@3.0.35 ### Patch Changes - 64a8fae: chore: remove obsolete model IDs for Anthropic, Google, OpenAI, xAI ## @ai-sdk/google-vertex@4.0.69 ### Patch Changes - 64a8fae: chore: remove obsolete model IDs for Anthropic, Google, OpenAI, xAI - Updated dependencies [64a8fae] - @ai-sdk/anthropic@3.0.51 - @ai-sdk/google@3.0.35 ## @ai-sdk/openai@3.0.38 ### Patch Changes - 64a8fae: chore: remove obsolete model IDs for Anthropic, Google, OpenAI, xAI ## @ai-sdk/xai@3.0.62 ### Patch Changes - 64a8fae: chore: remove obsolete model IDs for Anthropic, Google, OpenAI, xAI Co-authored-by: vercel-ai-sdk[bot] <225926702+vercel-ai-sdk[bot]@users.noreply.github.com>
## Background Provider instance name has changed, updated docs to reflect changes. ## Summary `providers\03-community-providers\09-browser-ai.mdx` updated
## Background
This PR normalizes Bedrock document names derived from part.filename by
stripping file extensions before sending requests in order to avoid
Bedrock throwing an exception.
## Summary
- Added a shared stripFileExtension(filename: string) helper to
@ai-sdk/provider-utils.
- Exported the helper from provider-utils public index.
- Updated Amazon Bedrock chat message conversion to use the helper for
document name when part.filename is present.
- Updated/added tests for Bedrock conversion behavior.
- Added unit tests for the new helper.
## Manual Verfication
<details>
<summary> repro example:</summary>
```ts
import { bedrock } from '@ai-sdk/amazon-bedrock';
import { generateText } from 'ai';
import fs from 'fs';
import { run } from '../../lib/run';
run(async () => {
const result = await generateText({
model: bedrock('global.anthropic.claude-sonnet-4-5-20250929-v1:0'),
messages: [
{
role: 'user',
content: [
{
type: 'text',
text: 'Summarize the content of this text file in a few sentences.',
},
{
type: 'file',
data: fs.readFileSync('./data/error-message.txt'),
mediaType: 'text/plain',
filename: 'error-message.txt',
},
],
},
],
});
console.log('Response:', result.text);
console.log();
console.log('Finish reason:', result.finishReason);
console.log('Usage:', result.usage);
});
```
</details>
## 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)
## Future Work
n/a
## Related Issues
Fixes #11518
---------
Co-authored-by: Aayush Kapoor <aayushkapoor34@gmail.com>
Co-authored-by: Aayush Kapoor <83492835+aayush-kapoor@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. # Releases ## ai@6.0.107 ### Patch Changes - Updated dependencies [08336f1] - @ai-sdk/provider-utils@4.0.17 - @ai-sdk/gateway@3.0.61 ## @ai-sdk/alibaba@1.0.7 ### Patch Changes - Updated dependencies [08336f1] - @ai-sdk/provider-utils@4.0.17 - @ai-sdk/openai-compatible@2.0.32 ## @ai-sdk/amazon-bedrock@4.0.71 ### Patch Changes - 08336f1: fix(bedrock): strip file extensions from filename - Updated dependencies [08336f1] - @ai-sdk/provider-utils@4.0.17 - @ai-sdk/anthropic@3.0.52 ## @ai-sdk/angular@2.0.108 ### Patch Changes - Updated dependencies [08336f1] - @ai-sdk/provider-utils@4.0.17 - ai@6.0.107 ## @ai-sdk/anthropic@3.0.52 ### Patch Changes - Updated dependencies [08336f1] - @ai-sdk/provider-utils@4.0.17 ## @ai-sdk/assemblyai@2.0.22 ### Patch Changes - Updated dependencies [08336f1] - @ai-sdk/provider-utils@4.0.17 ## @ai-sdk/azure@3.0.40 ### Patch Changes - Updated dependencies [08336f1] - @ai-sdk/provider-utils@4.0.17 - @ai-sdk/openai@3.0.39 ## @ai-sdk/baseten@1.0.35 ### Patch Changes - Updated dependencies [08336f1] - @ai-sdk/provider-utils@4.0.17 - @ai-sdk/openai-compatible@2.0.32 ## @ai-sdk/black-forest-labs@1.0.22 ### Patch Changes - Updated dependencies [08336f1] - @ai-sdk/provider-utils@4.0.17 ## @ai-sdk/bytedance@1.0.2 ### Patch Changes - Updated dependencies [08336f1] - @ai-sdk/provider-utils@4.0.17 ## @ai-sdk/cerebras@2.0.36 ### Patch Changes - Updated dependencies [08336f1] - @ai-sdk/provider-utils@4.0.17 - @ai-sdk/openai-compatible@2.0.32 ## @ai-sdk/cohere@3.0.23 ### Patch Changes - Updated dependencies [08336f1] - @ai-sdk/provider-utils@4.0.17 ## @ai-sdk/deepgram@2.0.22 ### Patch Changes - Updated dependencies [08336f1] - @ai-sdk/provider-utils@4.0.17 ## @ai-sdk/deepinfra@2.0.36 ### Patch Changes - Updated dependencies [08336f1] - @ai-sdk/provider-utils@4.0.17 - @ai-sdk/openai-compatible@2.0.32 ## @ai-sdk/deepseek@2.0.22 ### Patch Changes - Updated dependencies [08336f1] - @ai-sdk/provider-utils@4.0.17 ## @ai-sdk/elevenlabs@2.0.22 ### Patch Changes - Updated dependencies [08336f1] - @ai-sdk/provider-utils@4.0.17 ## @ai-sdk/fal@2.0.23 ### Patch Changes - Updated dependencies [08336f1] - @ai-sdk/provider-utils@4.0.17 ## @ai-sdk/fireworks@2.0.37 ### Patch Changes - Updated dependencies [08336f1] - @ai-sdk/provider-utils@4.0.17 - @ai-sdk/openai-compatible@2.0.32 ## @ai-sdk/gateway@3.0.61 ### Patch Changes - Updated dependencies [08336f1] - @ai-sdk/provider-utils@4.0.17 ## @ai-sdk/gladia@2.0.22 ### Patch Changes - Updated dependencies [08336f1] - @ai-sdk/provider-utils@4.0.17 ## @ai-sdk/google@3.0.36 ### Patch Changes - Updated dependencies [08336f1] - @ai-sdk/provider-utils@4.0.17 ## @ai-sdk/google-vertex@4.0.70 ### Patch Changes - Updated dependencies [08336f1] - @ai-sdk/provider-utils@4.0.17 - @ai-sdk/anthropic@3.0.52 - @ai-sdk/google@3.0.36 ## @ai-sdk/groq@3.0.27 ### Patch Changes - Updated dependencies [08336f1] - @ai-sdk/provider-utils@4.0.17 ## @ai-sdk/huggingface@1.0.34 ### Patch Changes - Updated dependencies [08336f1] - @ai-sdk/provider-utils@4.0.17 - @ai-sdk/openai-compatible@2.0.32 ## @ai-sdk/hume@2.0.22 ### Patch Changes - Updated dependencies [08336f1] - @ai-sdk/provider-utils@4.0.17 ## @ai-sdk/klingai@3.0.6 ### Patch Changes - Updated dependencies [08336f1] - @ai-sdk/provider-utils@4.0.17 ## @ai-sdk/langchain@2.0.113 ### Patch Changes - ai@6.0.107 ## @ai-sdk/llamaindex@2.0.107 ### Patch Changes - ai@6.0.107 ## @ai-sdk/lmnt@2.0.22 ### Patch Changes - Updated dependencies [08336f1] - @ai-sdk/provider-utils@4.0.17 ## @ai-sdk/luma@2.0.22 ### Patch Changes - Updated dependencies [08336f1] - @ai-sdk/provider-utils@4.0.17 ## @ai-sdk/mcp@1.0.23 ### Patch Changes - Updated dependencies [08336f1] - @ai-sdk/provider-utils@4.0.17 ## @ai-sdk/mistral@3.0.22 ### Patch Changes - Updated dependencies [08336f1] - @ai-sdk/provider-utils@4.0.17 ## @ai-sdk/moonshotai@2.0.7 ### Patch Changes - Updated dependencies [08336f1] - @ai-sdk/provider-utils@4.0.17 - @ai-sdk/openai-compatible@2.0.32 ## @ai-sdk/open-responses@1.0.4 ### Patch Changes - Updated dependencies [08336f1] - @ai-sdk/provider-utils@4.0.17 ## @ai-sdk/openai@3.0.39 ### Patch Changes - Updated dependencies [08336f1] - @ai-sdk/provider-utils@4.0.17 ## @ai-sdk/openai-compatible@2.0.32 ### Patch Changes - Updated dependencies [08336f1] - @ai-sdk/provider-utils@4.0.17 ## @ai-sdk/perplexity@3.0.21 ### Patch Changes - Updated dependencies [08336f1] - @ai-sdk/provider-utils@4.0.17 ## @ai-sdk/prodia@1.0.19 ### Patch Changes - Updated dependencies [08336f1] - @ai-sdk/provider-utils@4.0.17 ## @ai-sdk/provider-utils@4.0.17 ### Patch Changes - 08336f1: fix(bedrock): strip file extensions from filename ## @ai-sdk/react@3.0.109 ### Patch Changes - Updated dependencies [08336f1] - @ai-sdk/provider-utils@4.0.17 - ai@6.0.107 ## @ai-sdk/replicate@2.0.22 ### Patch Changes - Updated dependencies [08336f1] - @ai-sdk/provider-utils@4.0.17 ## @ai-sdk/revai@2.0.22 ### Patch Changes - Updated dependencies [08336f1] - @ai-sdk/provider-utils@4.0.17 ## @ai-sdk/rsc@2.0.107 ### Patch Changes - Updated dependencies [08336f1] - @ai-sdk/provider-utils@4.0.17 - ai@6.0.107 ## @ai-sdk/svelte@4.0.107 ### Patch Changes - Updated dependencies [08336f1] - @ai-sdk/provider-utils@4.0.17 - ai@6.0.107 ## @ai-sdk/togetherai@2.0.36 ### Patch Changes - Updated dependencies [08336f1] - @ai-sdk/provider-utils@4.0.17 - @ai-sdk/openai-compatible@2.0.32 ## @ai-sdk/valibot@2.0.18 ### Patch Changes - Updated dependencies [08336f1] - @ai-sdk/provider-utils@4.0.17 ## @ai-sdk/vercel@2.0.34 ### Patch Changes - Updated dependencies [08336f1] - @ai-sdk/provider-utils@4.0.17 - @ai-sdk/openai-compatible@2.0.32 ## @ai-sdk/vue@3.0.107 ### Patch Changes - Updated dependencies [08336f1] - @ai-sdk/provider-utils@4.0.17 - ai@6.0.107 ## @ai-sdk/xai@3.0.63 ### Patch Changes - Updated dependencies [08336f1] - @ai-sdk/provider-utils@4.0.17 - @ai-sdk/openai-compatible@2.0.32 Co-authored-by: vercel-ai-sdk[bot] <225926702+vercel-ai-sdk[bot]@users.noreply.github.com>
## Background reported in issue #12965 we decoded the base64 data properly in the anthropic provider but not in openai-compat ## Summary - added `convertBase64ToUint8Array` to properly decode the string before converting to text - replaced `Buffer.from(data, 'base64').toString('utf-8')` with the edge-runtime-safe equivalent using `convertBase64ToUint8Array` ## Manual Verification na ## 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) ## Related Issues fixes #12965
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. # Releases ## @ai-sdk/alibaba@1.0.8 ### Patch Changes - Updated dependencies [89caf28] - @ai-sdk/openai-compatible@2.0.33 ## @ai-sdk/amazon-bedrock@4.0.72 ### Patch Changes - Updated dependencies [89caf28] - @ai-sdk/anthropic@3.0.53 ## @ai-sdk/anthropic@3.0.53 ### Patch Changes - 89caf28: fix(openai-compat): decode base64 string data ## @ai-sdk/baseten@1.0.36 ### Patch Changes - Updated dependencies [89caf28] - @ai-sdk/openai-compatible@2.0.33 ## @ai-sdk/cerebras@2.0.37 ### Patch Changes - Updated dependencies [89caf28] - @ai-sdk/openai-compatible@2.0.33 ## @ai-sdk/deepinfra@2.0.37 ### Patch Changes - Updated dependencies [89caf28] - @ai-sdk/openai-compatible@2.0.33 ## @ai-sdk/fireworks@2.0.38 ### Patch Changes - Updated dependencies [89caf28] - @ai-sdk/openai-compatible@2.0.33 ## @ai-sdk/google-vertex@4.0.71 ### Patch Changes - Updated dependencies [89caf28] - @ai-sdk/anthropic@3.0.53 ## @ai-sdk/huggingface@1.0.35 ### Patch Changes - Updated dependencies [89caf28] - @ai-sdk/openai-compatible@2.0.33 ## @ai-sdk/moonshotai@2.0.8 ### Patch Changes - Updated dependencies [89caf28] - @ai-sdk/openai-compatible@2.0.33 ## @ai-sdk/openai-compatible@2.0.33 ### Patch Changes - 89caf28: fix(openai-compat): decode base64 string data ## @ai-sdk/togetherai@2.0.37 ### Patch Changes - Updated dependencies [89caf28] - @ai-sdk/openai-compatible@2.0.33 ## @ai-sdk/vercel@2.0.35 ### Patch Changes - Updated dependencies [89caf28] - @ai-sdk/openai-compatible@2.0.33 ## @ai-sdk/xai@3.0.64 ### Patch Changes - Updated dependencies [89caf28] - @ai-sdk/openai-compatible@2.0.33 Co-authored-by: vercel-ai-sdk[bot] <225926702+vercel-ai-sdk[bot]@users.noreply.github.com>
## Background we needed an interface that could be implemented by telemetry providers for capturing all the data that will be propagated via the callbacks ## Summary - `TelemetryHandler` : interface to create custom telemetry integrations - `expand-handlers.ts` : file turns handlers: [handlerA, handlerB, handlerC] into a single object with one callback per lifecycle event, where each callback fans out to every handler that needs info about that event - added new option `handlers` to the `telemetry-settings` for handlers that receive lifecycle events during generation ## Future Work make the `integrations` option work behind the scenes, ie without a need for it to be in experimental_telemetry ## 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)
## Summary Swaps out our JS-based linting and formatting toolchain for Rust-based equivalents. oxlint and oxfmt are significantly faster than ESLint and Prettier — see benchmarks below. ## What changed - Removed ESLint (config, plugins, per-package `lint` scripts, `turbo lint` task, CI job) - Removed Prettier (config, ignore files, per-package `prettier-check` scripts, CI job, auto-fix workflow) - Removed `lint-staged` from pre-commit hook (replaced with `pnpm fix`) - Removed `tools/eslint-config` package entirely - Added `oxlint` + `oxfmt` + `ultracite` with preconfigured rule sets for core, React, and Next.js - Added `.oxlintrc.json` and `.oxfmtrc.jsonc` configs tuned to match our existing code style - Replaced `prettier-on-automerge.yml` with `ultracite-on-automerge.yml` - CI now runs `ultracite check` in place of the ESLint and Prettier jobs ## Performance Measured against the last CI run on `main`: | Tool | Time | | --- | --- | | ESLint | 2m 8s | | Prettier | 1m 19s | | **oxlint + oxfmt (Ultracite)** | **36s** | Combined lint + format time goes from **3m 27s → 36s**, a ~**6x speedup** in CI. ## Why Ultracite One of the key advantages of Ultracite is that it's designed to run from the repo root, which eliminates the need for per-package lint configs and shared config packages like our old `tools/eslint-config`. Linting and formatting are now two commands run from one place: - `pnpm check` — runs oxlint + oxfmt check across the whole repo - `pnpm fix` — runs oxlint + oxfmt fix across the whole repo Ultracite is already in use across many other repos at Vercel, so this brings the AI SDK in line with the rest of the organisation. ## Why oxlint oxlint is designed as a 1:1 Rust port of ESLint, which is a big part of why the upfront diff here is small — the rule names, semantics, and even `// eslint-disable` comments are all compatible. Existing disable comments throughout the codebase continue to work as-is with no changes needed. ## On the diff size This PR shows ~7,000 additions and ~20,000 deletions, but don't be alarmed — roughly 26,000 of those lines are `pnpm-lock.yaml` churn from removing ESLint, Prettier, lint-staged, and all their transitive dependencies. The actual code changes are minimal. ## On the disabled rules A large number of oxlint rules have been turned off in `.oxlintrc.json` for this initial landing. The goal was to keep the diff reviewable — enabling everything at once would have touched hundreds of files. The goal going forward is to incrementally remove overrides from `.oxlintrc.json`, enabling more of Ultracite's built-in rules for code quality as the codebase is brought into compliance. ## On the modified files The remaining file changes fall into two categories: 1. Subtle formatting differences between oxfmt and Prettier that couldn't be config-matched away (mainly `class ... implements` placement) 2. Files that were previously excluded from Prettier via `.prettierignore` and are now being properly formatted for the first time
## background pr #13365 added generic `toolMs` to timeout configuration. this adds per-tool overrides so users can set different timeouts for different tools with full type safety ## summary - add `tools` object to `TimeoutConfiguration` for per-tool timeout overrides using `{toolName}Ms` pattern - type safety via template literal types: `${keyof TOOLS}Ms` gives autocomplete for tool names - `TimeoutConfiguration` is generic, typed with `NoInfer<TOOLS>` at `generateText`/`streamText` level - resolution order: per-tool (`tools.weatherMs`) > generic (`toolMs`) > no timeout - uses `Omit<CallSettings, 'timeout'>` to avoid intersection conflict with the generic timeout type ```ts generateText({ model: openai('gpt-5.4'), tools: { weather: weatherTool, slowApi: slowApiTool }, timeout: { toolMs: 5000, tools: { weatherMs: 3000, slowApiMs: 1000, }, }, prompt: 'What is the weather in tokyo?', }); ``` ## verification <details> <summary>type safety - invalid tool names caught</summary> ``` Object literal may only specify known properties, and 'typoMs' does not exist in type 'Partial<Record<"weatherMs" | "slowApiMs", number>>' ``` </details> <details> <summary>per-tool example - fastApi succeeds, slowApi times out</summary> ``` $ pnpm tsx src/generate-text/openai/tool-timeout-per-tool-error.ts tool-call: fastApi({"query":"hello"}) tool-call: slowApi({"query":"hello"}) tool-error: slowApi timed out Results for "hello": - Fast API: hello - Slow API: timed out / operation aborted ``` </details> ## checklist - [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 (run `pnpm changeset` in root) - [x] i have reviewed this pull request (self-review) ## related issues fixes #13279 --------- 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-beta.26 ### Patch Changes - f0b0b20: feat(ai): add per-tool timeout overrides via toolTimeouts ## @ai-sdk/angular@3.0.0-beta.26 ### Patch Changes - Updated dependencies [f0b0b20] - ai@7.0.0-beta.26 ## @ai-sdk/langchain@3.0.0-beta.26 ### Patch Changes - Updated dependencies [f0b0b20] - ai@7.0.0-beta.26 ## @ai-sdk/llamaindex@3.0.0-beta.26 ### Patch Changes - Updated dependencies [f0b0b20] - ai@7.0.0-beta.26 ## @ai-sdk/react@4.0.0-beta.26 ### Patch Changes - Updated dependencies [f0b0b20] - ai@7.0.0-beta.26 ## @ai-sdk/rsc@3.0.0-beta.27 ### Patch Changes - Updated dependencies [f0b0b20] - ai@7.0.0-beta.26 ## @ai-sdk/svelte@5.0.0-beta.26 ### Patch Changes - Updated dependencies [f0b0b20] - ai@7.0.0-beta.26 ## @ai-sdk/vue@4.0.0-beta.26 ### Patch Changes - Updated dependencies [f0b0b20] - ai@7.0.0-beta.26 Co-authored-by: vercel-ai-sdk[bot] <225926702+vercel-ai-sdk[bot]@users.noreply.github.com>
…n into create-stream-text-part-transformation (#13607) ## Background We are working towards better support for custom loop control. For this, we are separating out individual reusable functions from streamText. As a first step, we need to separate transformation steps such that each transformation has a single responsibility. ## Summary Move tool-call, tool-approval, tool-result transformation into create-stream-text-part-transformation. ## Related Issues towards #13570
## Summary - allow `data:` URLs through `validateDownloadUrl` because they are inline content, not network fetches - keep the existing SSRF protections for `http:` and `https:` URLs unchanged - add tests covering both validator acceptance and `download()` support for inline data URLs ## Testing - `pnpm exec prettier --check packages/provider-utils/src/validate-download-url.ts packages/provider-utils/src/validate-download-url.test.ts packages/ai/src/util/download/download.test.ts` - `pnpm install --frozen-lockfile` - Attempted package-local `vitest` runs, but the local workspace currently fails to resolve some internal package entries before reaching these tests under Node `v24.14.0` ## Why This Is Small And Safe This only changes protocol handling for `data:` URLs, which are already inline payloads and do not make outbound network requests. All existing hostname and private-address SSRF checks still apply to real network URLs. Closes #13354. Co-authored-by: Gregor Martynus <39992+gr2m@users.noreply.github.com>
## Background openai recently introduced server side compaction within responses api see https://developers.openai.com/api/docs/guides/compaction ## Summary updated the api spec to include the `compaction` block which is passed via the providerMetadata. it only includes encrypted content id along with it, so it doesn't need any text along with it. ## Manual Verification - verified via `examples/ai-functions/src/generate-text/openai-compaction.ts` - verified via `examples/ai-functions/src/stream-text/openai-compaction.ts` - verified via `localhost:3000/use-chat-openai-compaction` with multiturn conversation ## Checklist - [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 look into adding compaction endpoint https://developers.openai.com/api/reference/resources/responses/methods/compact ## Related Issues fixes #12486
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-beta.12 ### Patch Changes - Updated dependencies [d9a1e9a] - @ai-sdk/openai@4.0.0-beta.12 ## @ai-sdk/openai@4.0.0-beta.12 ### Patch Changes - d9a1e9a: feat(openai): add server side compaction for openai Co-authored-by: vercel-ai-sdk[bot] <225926702+vercel-ai-sdk[bot]@users.noreply.github.com>
…3629) ## Background We are working towards better support for custom loop control. For this, we are separating out individual reusable functions from streamText. As a first step, we need to separate transformation steps such that each transformation has a single responsibility. ## Summary * remove unused parameters * renamed `runToolsTransform` to `executeToolsTransform` * moved finish part transformation ## Related Issues towards #13570
## Background
The lint-staged config in package.json uses "*" which matches all files.
When only a .md file (like a changeset) is staged, ultracite fix
receives no JS/TS files it can process and exits with an error, blocking
the commit
Error received:
```sh
ai % git add .changeset/great-cows-rush.md && git commit -m "change cs"
✔ Backed up original state in git stash (ea29d32ee)
⚠ Running tasks for staged files...
❯ package.json — 1 file
❯ * — 1 file
✖ ultracite fix [FAILED]
↓ Skipped because of errors from tasks.
✔ Reverting to original state because of errors...
✔ Cleaning up temporary files...
✖ ultracite fix:
Expected at least one target file
husky - pre-commit script failed (code 1)
```
## Summary
narrow the lint-staged glob to only match file types ultracite handles
## Manual Verification
na
## Checklist
- [ ] 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)
## Background We are working towards better support for custom loop control. For this, we are separating out individual reusable functions from streamText. As a first step, we need to separate transformation steps such that each transformation has a single responsibility. ## Summary - replace `SingleRequestTextStreamPart` with `UglyTransformedStreamTextPart` - simplify `UglyTransformedStreamTextPart` type - introduce separate `TextStream*Part` types ## Related Issues Towards #13570
…upport it in `generateText` and `streamText` (#13553) ## Background Reasoning/thinking configuration has historically been handled entirely via `providerOptions`, requiring provider-specific knowledge from callers and making it impossible to write portable reasoning code. ## Summary Adds a top-level `reasoning` parameter to `generateText` and `streamText` (and the underlying `LanguageModelV4` call options spec), as proposed in #12516. The parameter accepts a flat enum — `'provider-default' | 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh'` — aligned with the OpenAI/OpenRouter convention. For the v4 spec, `'provider-default'` is omitted as that can be resolved at the `generateText` and `streamText` level by simply omitting the value. Existing `providerOptions` for each provider remain supported, both to help with a smooth transition path and to continue to support cases where a specific `providerOptions` behavior may be more granular than what the new top-level `reasoning` parameter allows. If reasoning-related keys are present in `providerOptions`, they take full precedence and the top-level `reasoning` parameter is ignored, so existing code continues to work without changes. Two helper functions are added to `provider-utils` to make provider-side mapping straightforward: - `mapReasoningToProviderEffort` — maps the enum to a provider's native effort string, emitting a compatibility warning if coercion is needed. - `mapReasoningToProviderBudget` — maps the enum to a token budget by multiplying the model's max output tokens by a percentage, clamped between a min and max budget. ### Provider migration status - [x] OpenAI — effort-based - [x] Anthropic — mixed (effort-based for newer models) - [x] Google — mixed (effort-based for newer models) - [x] Amazon Bedrock — mixed - [ ] xAI — effort-based - [ ] Groq — effort-based - [ ] DeepSeek — budget-based - [ ] Fireworks — effort-based - [ ] OpenAI Compatible — effort-based - [ ] Open Responses — effort-based - [ ] Perplexity — no reasoning support - [ ] Alibaba — no reasoning support - [ ] Azure — no reasoning support - [ ] Mistral — no reasoning support - [ ] Cohere — no reasoning support ## Manual Verification I ran all the relevant updated examples for each migrated provider, verifying they still work as before. ## Checklist - [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 - Migrate remaining providers (potentially via this PR, or in a follow up PR) - Consider deprecating use of certain `providerOptions` values that provide no benefit over the new top-level `reasoning` parameter ## Related Issues Fixes #12516
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-beta.27 ### Patch Changes - 3887c70: feat(provider): add new top-level reasoning parameter to spec and support it in `generateText` and `streamText` - Updated dependencies [3887c70] - @ai-sdk/provider-utils@5.0.0-beta.6 - @ai-sdk/provider@4.0.0-beta.4 - @ai-sdk/gateway@4.0.0-beta.17 ## @ai-sdk/alibaba@2.0.0-beta.10 ### Patch Changes - Updated dependencies [3887c70] - @ai-sdk/provider-utils@5.0.0-beta.6 - @ai-sdk/provider@4.0.0-beta.4 - @ai-sdk/openai-compatible@3.0.0-beta.8 ## @ai-sdk/amazon-bedrock@5.0.0-beta.10 ### Patch Changes - 3887c70: feat(provider): add new top-level reasoning parameter to spec and support it in `generateText` and `streamText` - Updated dependencies [3887c70] - @ai-sdk/provider-utils@5.0.0-beta.6 - @ai-sdk/anthropic@4.0.0-beta.10 - @ai-sdk/provider@4.0.0-beta.4 ## @ai-sdk/angular@3.0.0-beta.27 ### Patch Changes - Updated dependencies [3887c70] - @ai-sdk/provider-utils@5.0.0-beta.6 - ai@7.0.0-beta.27 ## @ai-sdk/anthropic@4.0.0-beta.10 ### Patch Changes - 3887c70: feat(provider): add new top-level reasoning parameter to spec and support it in `generateText` and `streamText` - Updated dependencies [3887c70] - @ai-sdk/provider-utils@5.0.0-beta.6 - @ai-sdk/provider@4.0.0-beta.4 ## @ai-sdk/assemblyai@3.0.0-beta.7 ### Patch Changes - Updated dependencies [3887c70] - @ai-sdk/provider-utils@5.0.0-beta.6 - @ai-sdk/provider@4.0.0-beta.4 ## @ai-sdk/azure@4.0.0-beta.13 ### Patch Changes - Updated dependencies [3887c70] - @ai-sdk/provider-utils@5.0.0-beta.6 - @ai-sdk/provider@4.0.0-beta.4 - @ai-sdk/openai@4.0.0-beta.13 ## @ai-sdk/baseten@2.0.0-beta.8 ### Patch Changes - Updated dependencies [3887c70] - @ai-sdk/provider-utils@5.0.0-beta.6 - @ai-sdk/provider@4.0.0-beta.4 - @ai-sdk/openai-compatible@3.0.0-beta.8 ## @ai-sdk/black-forest-labs@2.0.0-beta.6 ### Patch Changes - Updated dependencies [3887c70] - @ai-sdk/provider-utils@5.0.0-beta.6 - @ai-sdk/provider@4.0.0-beta.4 ## @ai-sdk/bytedance@2.0.0-beta.6 ### Patch Changes - Updated dependencies [3887c70] - @ai-sdk/provider-utils@5.0.0-beta.6 - @ai-sdk/provider@4.0.0-beta.4 ## @ai-sdk/cerebras@3.0.0-beta.8 ### Patch Changes - Updated dependencies [3887c70] - @ai-sdk/provider-utils@5.0.0-beta.6 - @ai-sdk/provider@4.0.0-beta.4 - @ai-sdk/openai-compatible@3.0.0-beta.8 ## @ai-sdk/cohere@4.0.0-beta.6 ### Patch Changes - Updated dependencies [3887c70] - @ai-sdk/provider-utils@5.0.0-beta.6 - @ai-sdk/provider@4.0.0-beta.4 ## @ai-sdk/deepgram@3.0.0-beta.6 ### Patch Changes - Updated dependencies [3887c70] - @ai-sdk/provider-utils@5.0.0-beta.6 - @ai-sdk/provider@4.0.0-beta.4 ## @ai-sdk/deepinfra@3.0.0-beta.8 ### Patch Changes - Updated dependencies [3887c70] - @ai-sdk/provider-utils@5.0.0-beta.6 - @ai-sdk/provider@4.0.0-beta.4 - @ai-sdk/openai-compatible@3.0.0-beta.8 ## @ai-sdk/deepseek@3.0.0-beta.7 ### Patch Changes - Updated dependencies [3887c70] - @ai-sdk/provider-utils@5.0.0-beta.6 - @ai-sdk/provider@4.0.0-beta.4 ## @ai-sdk/devtools@1.0.0-beta.4 ### Patch Changes - Updated dependencies [3887c70] - @ai-sdk/provider@4.0.0-beta.4 ## @ai-sdk/elevenlabs@3.0.0-beta.6 ### Patch Changes - Updated dependencies [3887c70] - @ai-sdk/provider-utils@5.0.0-beta.6 - @ai-sdk/provider@4.0.0-beta.4 ## @ai-sdk/fal@3.0.0-beta.6 ### Patch Changes - Updated dependencies [3887c70] - @ai-sdk/provider-utils@5.0.0-beta.6 - @ai-sdk/provider@4.0.0-beta.4 ## @ai-sdk/fireworks@3.0.0-beta.8 ### Patch Changes - Updated dependencies [3887c70] - @ai-sdk/provider-utils@5.0.0-beta.6 - @ai-sdk/provider@4.0.0-beta.4 - @ai-sdk/openai-compatible@3.0.0-beta.8 ## @ai-sdk/gateway@4.0.0-beta.17 ### Patch Changes - Updated dependencies [3887c70] - @ai-sdk/provider-utils@5.0.0-beta.6 - @ai-sdk/provider@4.0.0-beta.4 ## @ai-sdk/gladia@3.0.0-beta.6 ### Patch Changes - Updated dependencies [3887c70] - @ai-sdk/provider-utils@5.0.0-beta.6 - @ai-sdk/provider@4.0.0-beta.4 ## @ai-sdk/google@4.0.0-beta.14 ### Patch Changes - 3887c70: feat(provider): add new top-level reasoning parameter to spec and support it in `generateText` and `streamText` - Updated dependencies [3887c70] - @ai-sdk/provider-utils@5.0.0-beta.6 - @ai-sdk/provider@4.0.0-beta.4 ## @ai-sdk/google-vertex@5.0.0-beta.19 ### Patch Changes - Updated dependencies [3887c70] - @ai-sdk/provider-utils@5.0.0-beta.6 - @ai-sdk/anthropic@4.0.0-beta.10 - @ai-sdk/provider@4.0.0-beta.4 - @ai-sdk/google@4.0.0-beta.14 ## @ai-sdk/groq@4.0.0-beta.7 ### Patch Changes - Updated dependencies [3887c70] - @ai-sdk/provider-utils@5.0.0-beta.6 - @ai-sdk/provider@4.0.0-beta.4 ## @ai-sdk/huggingface@2.0.0-beta.8 ### Patch Changes - Updated dependencies [3887c70] - @ai-sdk/provider-utils@5.0.0-beta.6 - @ai-sdk/provider@4.0.0-beta.4 - @ai-sdk/openai-compatible@3.0.0-beta.8 ## @ai-sdk/hume@3.0.0-beta.6 ### Patch Changes - Updated dependencies [3887c70] - @ai-sdk/provider-utils@5.0.0-beta.6 - @ai-sdk/provider@4.0.0-beta.4 ## @ai-sdk/klingai@4.0.0-beta.7 ### Patch Changes - Updated dependencies [3887c70] - @ai-sdk/provider-utils@5.0.0-beta.6 - @ai-sdk/provider@4.0.0-beta.4 ## @ai-sdk/langchain@3.0.0-beta.27 ### Patch Changes - Updated dependencies [3887c70] - ai@7.0.0-beta.27 ## @ai-sdk/llamaindex@3.0.0-beta.27 ### Patch Changes - Updated dependencies [3887c70] - ai@7.0.0-beta.27 ## @ai-sdk/lmnt@3.0.0-beta.6 ### Patch Changes - Updated dependencies [3887c70] - @ai-sdk/provider-utils@5.0.0-beta.6 - @ai-sdk/provider@4.0.0-beta.4 ## @ai-sdk/luma@3.0.0-beta.6 ### Patch Changes - Updated dependencies [3887c70] - @ai-sdk/provider-utils@5.0.0-beta.6 - @ai-sdk/provider@4.0.0-beta.4 ## @ai-sdk/mcp@2.0.0-beta.10 ### Patch Changes - Updated dependencies [3887c70] - @ai-sdk/provider-utils@5.0.0-beta.6 - @ai-sdk/provider@4.0.0-beta.4 ## @ai-sdk/mistral@4.0.0-beta.6 ### Patch Changes - Updated dependencies [3887c70] - @ai-sdk/provider-utils@5.0.0-beta.6 - @ai-sdk/provider@4.0.0-beta.4 ## @ai-sdk/moonshotai@3.0.0-beta.8 ### Patch Changes - Updated dependencies [3887c70] - @ai-sdk/provider-utils@5.0.0-beta.6 - @ai-sdk/provider@4.0.0-beta.4 - @ai-sdk/openai-compatible@3.0.0-beta.8 ## @ai-sdk/open-responses@2.0.0-beta.7 ### Patch Changes - Updated dependencies [3887c70] - @ai-sdk/provider-utils@5.0.0-beta.6 - @ai-sdk/provider@4.0.0-beta.4 ## @ai-sdk/openai@4.0.0-beta.13 ### Patch Changes - 3887c70: feat(provider): add new top-level reasoning parameter to spec and support it in `generateText` and `streamText` - Updated dependencies [3887c70] - @ai-sdk/provider-utils@5.0.0-beta.6 - @ai-sdk/provider@4.0.0-beta.4 ## @ai-sdk/openai-compatible@3.0.0-beta.8 ### Patch Changes - Updated dependencies [3887c70] - @ai-sdk/provider-utils@5.0.0-beta.6 - @ai-sdk/provider@4.0.0-beta.4 ## @ai-sdk/perplexity@4.0.0-beta.7 ### Patch Changes - Updated dependencies [3887c70] - @ai-sdk/provider-utils@5.0.0-beta.6 - @ai-sdk/provider@4.0.0-beta.4 ## @ai-sdk/prodia@2.0.0-beta.8 ### Patch Changes - Updated dependencies [3887c70] - @ai-sdk/provider-utils@5.0.0-beta.6 - @ai-sdk/provider@4.0.0-beta.4 ## @ai-sdk/provider@4.0.0-beta.4 ### Patch Changes - 3887c70: feat(provider): add new top-level reasoning parameter to spec and support it in `generateText` and `streamText` ## @ai-sdk/provider-utils@5.0.0-beta.6 ### Patch Changes - 3887c70: feat(provider): add new top-level reasoning parameter to spec and support it in `generateText` and `streamText` - Updated dependencies [3887c70] - @ai-sdk/provider@4.0.0-beta.4 ## @ai-sdk/react@4.0.0-beta.27 ### Patch Changes - Updated dependencies [3887c70] - @ai-sdk/provider-utils@5.0.0-beta.6 - ai@7.0.0-beta.27 ## @ai-sdk/replicate@3.0.0-beta.7 ### Patch Changes - Updated dependencies [3887c70] - @ai-sdk/provider-utils@5.0.0-beta.6 - @ai-sdk/provider@4.0.0-beta.4 ## @ai-sdk/revai@3.0.0-beta.7 ### Patch Changes - Updated dependencies [3887c70] - @ai-sdk/provider-utils@5.0.0-beta.6 - @ai-sdk/provider@4.0.0-beta.4 ## @ai-sdk/rsc@3.0.0-beta.28 ### Patch Changes - Updated dependencies [3887c70] - @ai-sdk/provider-utils@5.0.0-beta.6 - @ai-sdk/provider@4.0.0-beta.4 - ai@7.0.0-beta.27 ## @ai-sdk/svelte@5.0.0-beta.27 ### Patch Changes - Updated dependencies [3887c70] - @ai-sdk/provider-utils@5.0.0-beta.6 - ai@7.0.0-beta.27 ## @ai-sdk/togetherai@3.0.0-beta.8 ### Patch Changes - Updated dependencies [3887c70] - @ai-sdk/provider-utils@5.0.0-beta.6 - @ai-sdk/provider@4.0.0-beta.4 - @ai-sdk/openai-compatible@3.0.0-beta.8 ## @ai-sdk/valibot@3.0.0-beta.6 ### Patch Changes - Updated dependencies [3887c70] - @ai-sdk/provider-utils@5.0.0-beta.6 ## @ai-sdk/vercel@3.0.0-beta.8 ### Patch Changes - Updated dependencies [3887c70] - @ai-sdk/provider-utils@5.0.0-beta.6 - @ai-sdk/provider@4.0.0-beta.4 - @ai-sdk/openai-compatible@3.0.0-beta.8 ## @ai-sdk/vue@4.0.0-beta.27 ### Patch Changes - Updated dependencies [3887c70] - @ai-sdk/provider-utils@5.0.0-beta.6 - ai@7.0.0-beta.27 ## @ai-sdk/xai@4.0.0-beta.14 ### Patch Changes - Updated dependencies [3887c70] - @ai-sdk/provider-utils@5.0.0-beta.6 - @ai-sdk/provider@4.0.0-beta.4 - @ai-sdk/openai-compatible@3.0.0-beta.8 Co-authored-by: vercel-ai-sdk[bot] <225926702+vercel-ai-sdk[bot]@users.noreply.github.com>
… is finished (#13638) ## Background We are working towards better support for custom loop control. Until now, `streamText` starts tool execution immediately when a tool call arrives. While this enables tools to be executed without delay, it prevents clear separation of model calls from tool execution, which is required for external loop control, e.g. in the Workflow SDK. ## Summary Delay tool execution until model call sends `finish` chunk (**breaking behavior change**) ## Related Issues Towards #13570
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-beta.28 ### Major Changes - b9cf502: refactoring(ai): delay tool execution in stream text until model call is finished ## @ai-sdk/angular@3.0.0-beta.28 ### Patch Changes - Updated dependencies [b9cf502] - ai@7.0.0-beta.28 ## @ai-sdk/langchain@3.0.0-beta.28 ### Patch Changes - Updated dependencies [b9cf502] - ai@7.0.0-beta.28 ## @ai-sdk/llamaindex@3.0.0-beta.28 ### Patch Changes - Updated dependencies [b9cf502] - ai@7.0.0-beta.28 ## @ai-sdk/react@4.0.0-beta.28 ### Patch Changes - Updated dependencies [b9cf502] - ai@7.0.0-beta.28 ## @ai-sdk/rsc@3.0.0-beta.29 ### Patch Changes - Updated dependencies [b9cf502] - ai@7.0.0-beta.28 ## @ai-sdk/svelte@5.0.0-beta.28 ### Patch Changes - Updated dependencies [b9cf502] - ai@7.0.0-beta.28 ## @ai-sdk/vue@4.0.0-beta.28 ### Patch Changes - Updated dependencies [b9cf502] - ai@7.0.0-beta.28 Co-authored-by: vercel-ai-sdk[bot] <225926702+vercel-ai-sdk[bot]@users.noreply.github.com>
## Summary Freshened up the README to use latest models, and more straightforward examples. Also added tags to npm package.
## Background as a follow up to this PR #13478, specifically [this comment](#13478 (comment)), there was uneccessary convolution of the data ## Summary - flatten the `model: {provider, modelId}` to be `provider` and `modelId` individually - rename `callback-events.ts` to `core-events.ts` ## Manual Verification na ## 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) --------- Co-authored-by: Gregor Martynus <39992+gr2m@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-beta.29 ### Patch Changes - 877bf12: fix(ai): flatten model attributes for telemetry ## @ai-sdk/angular@3.0.0-beta.29 ### Patch Changes - Updated dependencies [877bf12] - ai@7.0.0-beta.29 ## @ai-sdk/langchain@3.0.0-beta.29 ### Patch Changes - Updated dependencies [877bf12] - ai@7.0.0-beta.29 ## @ai-sdk/llamaindex@3.0.0-beta.29 ### Patch Changes - Updated dependencies [877bf12] - ai@7.0.0-beta.29 ## @ai-sdk/react@4.0.0-beta.29 ### Patch Changes - Updated dependencies [877bf12] - ai@7.0.0-beta.29 ## @ai-sdk/rsc@3.0.0-beta.30 ### Patch Changes - Updated dependencies [877bf12] - ai@7.0.0-beta.29 ## @ai-sdk/svelte@5.0.0-beta.29 ### Patch Changes - Updated dependencies [877bf12] - ai@7.0.0-beta.29 ## @ai-sdk/vue@4.0.0-beta.29 ### Patch Changes - Updated dependencies [877bf12] - ai@7.0.0-beta.29 Co-authored-by: vercel-ai-sdk[bot] <225926702+vercel-ai-sdk[bot]@users.noreply.github.com>
follow up to #13636 --------- Co-authored-by: Tmo <thibault.mirandadeoliveira@vercel.com> Co-authored-by: Thibault Miranda de Oliveira <thibault.mirandadeoliveira@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-beta.30 ### Patch Changes - f5a6f89: README updates ## @ai-sdk/angular@3.0.0-beta.30 ### Patch Changes - Updated dependencies [f5a6f89] - ai@7.0.0-beta.30 ## @ai-sdk/langchain@3.0.0-beta.30 ### Patch Changes - Updated dependencies [f5a6f89] - ai@7.0.0-beta.30 ## @ai-sdk/llamaindex@3.0.0-beta.30 ### Patch Changes - Updated dependencies [f5a6f89] - ai@7.0.0-beta.30 ## @ai-sdk/react@4.0.0-beta.30 ### Patch Changes - Updated dependencies [f5a6f89] - ai@7.0.0-beta.30 ## @ai-sdk/rsc@3.0.0-beta.31 ### Patch Changes - Updated dependencies [f5a6f89] - ai@7.0.0-beta.30 ## @ai-sdk/svelte@5.0.0-beta.30 ### Patch Changes - Updated dependencies [f5a6f89] - ai@7.0.0-beta.30 ## @ai-sdk/vue@4.0.0-beta.30 ### Patch Changes - Updated dependencies [f5a6f89] - ai@7.0.0-beta.30 Co-authored-by: vercel-ai-sdk[bot] <225926702+vercel-ai-sdk[bot]@users.noreply.github.com>
#13648) ## Background The new top-level `reasoning` parameter was added to the AI SDK spec and core in #13553. Providers need to be migrated to translate this parameter into their native reasoning/thinking configuration. ## Summary Migrates 7 providers to support the new top-level `reasoning` parameter: - **deepseek**: Maps `reasoning` to existing thinking support (already had infrastructure, just needed wiring) - **groq**: Maps `reasoning` to `reasoning_effort` in provider options - **xai**: Maps `reasoning` to `reasoning_effort` for both chat and responses models - **openai-compatible**: Maps `reasoning` to `reasoning_effort` in provider options - **open-responses**: Maps `reasoning` to `reasoning.effort` in the responses format - **alibaba**: Maps `reasoning` to `enable_thinking` + `thinking_budget` via token budget calculation - **cohere**: Maps `reasoning` to `thinking.type` + `thinking.token_budget` via token budget calculation - **fireworks**: Uses **openai-compatible** Together with #13649, this completes the work on #12516. ## Manual Verification Relevant examples were updated or added, then run for verification. ## 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) ## Future Work N/A ## Related Issues See #12516.
…rameter (#13649) ## Background A new top-level `reasoning` parameter was added to the AI SDK spec in #13553 and is supported in `generateText`/`streamText`. Providers that don't natively support reasoning configuration need to emit an unsupported warning when a custom reasoning value is passed, rather than silently ignoring it. ## Summary - Added unsupported-feature warnings to `perplexity`, `mistral`, and `prodia` providers when `isCustomReasoning(reasoning)` returns `true` - Added documentation to `architecture/provider-abstraction.md` explaining how providers should handle the `reasoning` parameter (effort mapping, budget mapping, or unsupported warning). Together with #13648, this completes the work on #12516. ## Manual Verification N/A ## Checklist - [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 See #12516.
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/alibaba@2.0.0-beta.11 ### Patch Changes - 74d520f: feat: migrate providers to support new top-level `reasoning` parameter - Updated dependencies [74d520f] - @ai-sdk/openai-compatible@3.0.0-beta.9 ## @ai-sdk/baseten@2.0.0-beta.9 ### Patch Changes - Updated dependencies [74d520f] - @ai-sdk/openai-compatible@3.0.0-beta.9 ## @ai-sdk/cerebras@3.0.0-beta.9 ### Patch Changes - Updated dependencies [74d520f] - @ai-sdk/openai-compatible@3.0.0-beta.9 ## @ai-sdk/cohere@4.0.0-beta.7 ### Patch Changes - 74d520f: feat: migrate providers to support new top-level `reasoning` parameter ## @ai-sdk/deepinfra@3.0.0-beta.9 ### Patch Changes - Updated dependencies [74d520f] - @ai-sdk/openai-compatible@3.0.0-beta.9 ## @ai-sdk/deepseek@3.0.0-beta.8 ### Patch Changes - 74d520f: feat: migrate providers to support new top-level `reasoning` parameter ## @ai-sdk/fireworks@3.0.0-beta.9 ### Patch Changes - 74d520f: feat: migrate providers to support new top-level `reasoning` parameter - Updated dependencies [74d520f] - @ai-sdk/openai-compatible@3.0.0-beta.9 ## @ai-sdk/groq@4.0.0-beta.8 ### Patch Changes - 74d520f: feat: migrate providers to support new top-level `reasoning` parameter ## @ai-sdk/huggingface@2.0.0-beta.9 ### Patch Changes - Updated dependencies [74d520f] - @ai-sdk/openai-compatible@3.0.0-beta.9 ## @ai-sdk/mistral@4.0.0-beta.7 ### Patch Changes - 5259a95: chore: add warning for providers that do not support new reasoning parameter ## @ai-sdk/moonshotai@3.0.0-beta.9 ### Patch Changes - Updated dependencies [74d520f] - @ai-sdk/openai-compatible@3.0.0-beta.9 ## @ai-sdk/open-responses@2.0.0-beta.8 ### Patch Changes - 74d520f: feat: migrate providers to support new top-level `reasoning` parameter ## @ai-sdk/openai-compatible@3.0.0-beta.9 ### Patch Changes - 74d520f: feat: migrate providers to support new top-level `reasoning` parameter ## @ai-sdk/perplexity@4.0.0-beta.8 ### Patch Changes - 5259a95: chore: add warning for providers that do not support new reasoning parameter ## @ai-sdk/prodia@2.0.0-beta.9 ### Patch Changes - 5259a95: chore: add warning for providers that do not support new reasoning parameter ## @ai-sdk/togetherai@3.0.0-beta.9 ### Patch Changes - Updated dependencies [74d520f] - @ai-sdk/openai-compatible@3.0.0-beta.9 ## @ai-sdk/vercel@3.0.0-beta.9 ### Patch Changes - Updated dependencies [74d520f] - @ai-sdk/openai-compatible@3.0.0-beta.9 ## @ai-sdk/xai@4.0.0-beta.15 ### Patch Changes - 74d520f: feat: migrate providers to support new top-level `reasoning` parameter - Updated dependencies [74d520f] - @ai-sdk/openai-compatible@3.0.0-beta.9 Co-authored-by: vercel-ai-sdk[bot] <225926702+vercel-ai-sdk[bot]@users.noreply.github.com>
…ively unused there (#13641) ## Background In #13536, `CallSettings<TOOLS>` was made generic solely because of `timeout` (`TimeoutConfiguration<TOOLS>` uses tool-specific keys). I looked into making `prepareCallSettings` generic too as a result (see https://github.com/vercel/ai/pull/13536/changes#r2961226981), but that led me to a more important finding: `timeout` is never accessed through a `CallSettings`-typed variable — it's always destructured independently and handled via standalone helper functions. This generic propagates through many files unnecessarily, and `timeout` being part of `CallSettings` is probably no longer relevant. ## Summary - Remove `timeout` from `CallSettings` and make it non-generic. In `generateText`, `streamText`, and `ToolLoopAgentSettings`, `timeout` is added as a standalone property in the object literal type, preserving the public API while keeping the tool-specific generic only where it's actually needed. - Remove dead timeout-handling code in `getBaseTelemetryAttributes` that was unreachable since no caller ever passed `timeout` in the settings object. Given that `CallSettings` is exported, this can be considered a low-severity breaking change. But we're working in the v7 branch, so this is fine. ## Manual Verification N/A — internal type refactor, verified via type checking and existing test suites. ## 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) ## Future Work - A few places didn't actually support passing through `timeout` which maybe should allow it (e.g. `streamUI()`) - before it wasn't possible because `prepareCallSettings` would strip `timeout`, now `timeout` is formally removed from `CallSettings` - possibly something to fix, but worth noting this PR doesn't make it worse - Consider breaking out `abortSignal`, `headers`, and `maxRetries` from `CallSettings` as well. - Potentially create a separate `RequestSettings` type that contains these 3, plus `timeout`. Could then also rename `CallSettings` to something more descriptive, e.g. `ModelCallSettings`. ## Related Issues N/A
This is an automated update of the gateway model settings files. Co-authored-by: vercel-ai-sdk[bot] <225926702+vercel-ai-sdk[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-beta.31 ### Patch Changes - e79e644: chore(ai/core): remove `timeout` from `CallSettings` as it was effectively unused there ## @ai-sdk/angular@3.0.0-beta.31 ### Patch Changes - Updated dependencies [e79e644] - ai@7.0.0-beta.31 ## @ai-sdk/langchain@3.0.0-beta.31 ### Patch Changes - Updated dependencies [e79e644] - ai@7.0.0-beta.31 ## @ai-sdk/llamaindex@3.0.0-beta.31 ### Patch Changes - Updated dependencies [e79e644] - ai@7.0.0-beta.31 ## @ai-sdk/react@4.0.0-beta.31 ### Patch Changes - Updated dependencies [e79e644] - ai@7.0.0-beta.31 ## @ai-sdk/rsc@3.0.0-beta.32 ### Patch Changes - e79e644: chore(ai/core): remove `timeout` from `CallSettings` as it was effectively unused there - Updated dependencies [e79e644] - ai@7.0.0-beta.31 ## @ai-sdk/svelte@5.0.0-beta.31 ### Patch Changes - Updated dependencies [e79e644] - ai@7.0.0-beta.31 ## @ai-sdk/vue@4.0.0-beta.31 ### Patch Changes - Updated dependencies [e79e644] - ai@7.0.0-beta.31 Co-authored-by: vercel-ai-sdk[bot] <225926702+vercel-ai-sdk[bot]@users.noreply.github.com>
…ion and forward chunks before callback invocation (#13681) ## Background We are working towards better support for custom loop control. For this, we are separating out individual reusable functions from streamText. As a first step, we need to separate transformation steps such that each transformation has a single responsibility. ## Summary - move invocation of tool callbacks into its own function - this has a breaking behavior change: before, tool callbacks have been invoked before a chunk was forwarded. Now the order flipped. ## Related issues towards #13570
…n responses (#12777) <!-- Welcome to contributing to AI SDK! We're excited to see your changes. We suggest you read the following contributing guide we've created before submitting: https://github.com/vercel/ai/blob/main/CONTRIBUTING.md --> ## Background <!-- Why was this change necessary? --> Google provider tool results with `output.type = 'content'` were not fully mapped into Gemini `functionResponse.parts`, which blocked reliable multimodal tool-result flows for images/files. ## Summary <!-- What did you change? --> This PR adds multimodal tool-result support for `@ai-sdk/google` function responses and documents provider limitations. ### Provider changes - Updated `packages/google/src/convert-to-google-generative-ai-messages.ts` to: - Map `image-data` and `file-data` tool-result parts into `functionResponse.parts` as `inlineData`. - Support URL-style parts (`image-url`, `file-url`) **only** when they are base64 `data:` URLs. - Throw `UnsupportedFunctionalityError` for remote HTTP(S) URL-style tool-result parts. - Updated `packages/google/src/google-generative-ai-prompt.ts` types to allow: - `functionResponse.parts` with inline media payloads. ### Tests - Added/updated tests in `packages/google/src/convert-to-google-generative-ai-messages.test.ts` for: - `image-data` mapping - `file-data` mapping - `image-url` base64 `data:` URL mapping - Error on non-data `image-url` - Error on non-data `file-url` ### Docs - Updated `content/docs/03-ai-sdk-core/15-tools-and-tool-calling.mdx`: - Added Google support note (Gemini 3 models). - Documented that Google tool-result URL-style media must use base64 `data:` URLs (remote HTTP(S) URLs are not supported). ### Examples - Replaced combined toggle example with focused scripts: - `examples/ai-functions/src/generate-text/google-image-tool-result-base64.ts` - `examples/ai-functions/src/generate-text/google-image-tool-result-url.ts` - `examples/ai-functions/src/generate-text/google-pdf-tool-results-base64.ts` - `examples/ai-functions/src/generate-text/google-pdf-tool-results-url.ts` - Removed: - `examples/ai-functions/src/generate-text/google-image-tool-results.ts` ### Changeset - Added `.changeset/google-multimodal-tool-results.md` (patch for `@ai-sdk/google`). ## Manual Verification <!-- For features & bugfixes. Please explain how you *manually* verified that the change works end-to-end as expected (excluding automated tests). Remove the section if it's not needed (e.g. for docs). --> - Ran targeted provider tests: - `pnpm --filter @ai-sdk/google test:node -- convert-to-google-generative-ai-messages.test.ts` - Ran type checks: - `pnpm --filter @ai-sdk/google type-check` - `pnpm --filter @example/ai-functions type-check` - Ran lint/format checks on changed files: - `pnpm exec eslint ...` - `pnpm exec prettier --check ...` ## 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] 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 <!-- Feel free to mention things not covered by this PR that can be done in future PRs. Remove the section if it's not needed. --> ## Related Issues <!-- List related issues here, e.g. "Fixes #1234". Remove the section if it's not needed. --> N/A --------- Co-authored-by: Felix Arntz <felix.arntz@vercel.com>
…ral-small-latest) (#13688) ## Background Mistral Small 4 (`mistral-small-2603`) supports a `reasoning_effort` API parameter (`"high"` / `"none"`). The mistral provider already handles reasoning **output** (thinking blocks from magistral-* models), but does not support reasoning configuration yet. ## Summary - Maps the AI SDK's top-level `reasoning` parameter (see #12516) to Mistral's `reasoning_effort` for models that support it (`mistral-small-latest`, `mistral-small-2603`). Also adds a `reasoningEffort` provider option for direct control. Non-supporting models continue to emit an unsupported warning, as before. - Since Mistral only supports `"high"` and `"none"`, all reasoning levels (`minimal` through `xhigh`) map to `"high"` with a compatibility warning for non-exact matches, similar pattern to other providers. - Updates the Mistral model ID list with the new model ID and a few other missing flagship models and removing obsolete models (verified via their API). - Adds documentation and examples. ## Manual Verification Run the new examples to verify. ## Checklist - [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 Fixes #13595
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-beta.32 ### Major Changes - 4b46062: refactoring(ai): extract tool callback invocation into separate function and forward chunks before callback invocation ### Patch Changes - Updated dependencies [165b97a] - @ai-sdk/gateway@4.0.0-beta.18 ## @ai-sdk/angular@3.0.0-beta.32 ### Patch Changes - Updated dependencies [4b46062] - ai@7.0.0-beta.32 ## @ai-sdk/gateway@4.0.0-beta.18 ### Patch Changes - 165b97a: chore(provider/gateway): update gateway model settings files ## @ai-sdk/google@4.0.0-beta.15 ### Patch Changes - 18c1970: feat(provider/google): Add multimodal tool-result support for Google function responses. Tool results with `output.type = 'content'` now map media parts into `functionResponse.parts` for Google models, including `image-data`, `file-data`, and base64 `data:` URLs in URL-style content parts. Remote HTTP(S) URLs in URL-style tool-result parts are not supported. ## @ai-sdk/google-vertex@5.0.0-beta.20 ### Patch Changes - Updated dependencies [18c1970] - @ai-sdk/google@4.0.0-beta.15 ## @ai-sdk/langchain@3.0.0-beta.32 ### Patch Changes - Updated dependencies [4b46062] - ai@7.0.0-beta.32 ## @ai-sdk/llamaindex@3.0.0-beta.32 ### Patch Changes - Updated dependencies [4b46062] - ai@7.0.0-beta.32 ## @ai-sdk/mistral@4.0.0-beta.8 ### Patch Changes - 737b8f4: feat(provider/mistral): add support for reasoning configuration (mistral-small-latest) ## @ai-sdk/react@4.0.0-beta.32 ### Patch Changes - Updated dependencies [4b46062] - ai@7.0.0-beta.32 ## @ai-sdk/rsc@3.0.0-beta.33 ### Patch Changes - Updated dependencies [4b46062] - ai@7.0.0-beta.32 ## @ai-sdk/svelte@5.0.0-beta.32 ### Patch Changes - Updated dependencies [4b46062] - ai@7.0.0-beta.32 ## @ai-sdk/vue@4.0.0-beta.32 ### Patch Changes - Updated dependencies [4b46062] - ai@7.0.0-beta.32 Co-authored-by: vercel-ai-sdk[bot] <225926702+vercel-ai-sdk[bot]@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