-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Comparing changes
Open a pull request
base repository: vercel/ai
base: ai@6.0.103
head repository: vercel/ai
compare: ai@6.0.104
- 12 commits
- 86 files changed
- 7 contributors
Commits on Feb 26, 2026
-
fix(bedrock/groq): pass strict mode for tools (#12893)
## 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
Configuration menu - View commit details
-
Copy full SHA for 91f8777 - Browse repository at this point
Copy the full SHA 91f8777View commit details -
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>
vercel-ai-sdk[bot] authoredFeb 26, 2026 Configuration menu - View commit details
-
Copy full SHA for 9900541 - Browse repository at this point
Copy the full SHA 9900541View commit details -
feat(provider/google): add support for new Google image model aspect …
…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
Configuration menu - View commit details
-
Copy full SHA for 1ece97a - Browse repository at this point
Copy the full SHA 1ece97aView commit details -
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>
vercel-ai-sdk[bot] authoredFeb 26, 2026 Configuration menu - View commit details
-
Copy full SHA for 732a2ba - Browse repository at this point
Copy the full SHA 732a2baView commit details -
fix(openai): allow null/undefined type in streaming tool call deltas (#…
…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>
Configuration menu - View commit details
-
Copy full SHA for 53bdfa5 - Browse repository at this point
Copy the full SHA 53bdfa5View commit details -
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>
vercel-ai-sdk[bot] authoredFeb 26, 2026 Configuration menu - View commit details
-
Copy full SHA for 8acb431 - Browse repository at this point
Copy the full SHA 8acb431View commit details -
feat(anthropic): add the new code_execution tool (#12900)
## 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
Configuration menu - View commit details
-
Copy full SHA for 2164cdf - Browse repository at this point
Copy the full SHA 2164cdfView commit details -
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>
vercel-ai-sdk[bot] authoredFeb 26, 2026 Configuration menu - View commit details
-
Copy full SHA for 97c7b9f - Browse repository at this point
Copy the full SHA 97c7b9fView commit details
Commits on Feb 27, 2026
-
fix(anthropic, amazon-bedrock): migrate output_format to output_confi…
…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>
Configuration menu - View commit details
-
Copy full SHA for d98d9ba - Browse repository at this point
Copy the full SHA d98d9baView commit details -
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>
vercel-ai-sdk[bot] authoredFeb 27, 2026 Configuration menu - View commit details
-
Copy full SHA for acfa8b9 - Browse repository at this point
Copy the full SHA acfa8b9View commit details -
chore(provider/gateway): update gateway model settings files (#12918)
vercel-ai-sdk[bot] authoredFeb 27, 2026 Configuration menu - View commit details
-
Copy full SHA for 1330f2f - Browse repository at this point
Copy the full SHA 1330f2fView commit details -
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>
vercel-ai-sdk[bot] authoredFeb 27, 2026 Configuration menu - View commit details
-
Copy full SHA for 5ae109c - Browse repository at this point
Copy the full SHA 5ae109cView commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff ai@6.0.103...ai@6.0.104