Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: vercel/ai
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ai@6.0.103
Choose a base ref
...
head repository: vercel/ai
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: ai@6.0.104
Choose a head ref
  • 12 commits
  • 86 files changed
  • 7 contributors

Commits on Feb 26, 2026

  1. 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
    aayush-kapoor authored Feb 26, 2026
    Configuration menu
    Copy the full SHA
    91f8777 View commit details
    Browse the repository at this point in the history
  2. Version Packages (#12896)

    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] authored Feb 26, 2026
    Configuration menu
    Copy the full SHA
    9900541 View commit details
    Browse the repository at this point in the history
  3. 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
    felixarntz authored Feb 26, 2026
    Configuration menu
    Copy the full SHA
    1ece97a View commit details
    Browse the repository at this point in the history
  4. Version Packages (#12899)

    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] authored Feb 26, 2026
    Configuration menu
    Copy the full SHA
    732a2ba View commit details
    Browse the repository at this point in the history
  5. 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>
    sleitor and sleitor authored Feb 26, 2026
    Configuration menu
    Copy the full SHA
    53bdfa5 View commit details
    Browse the repository at this point in the history
  6. Version Packages (#12906)

    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] authored Feb 26, 2026
    Configuration menu
    Copy the full SHA
    8acb431 View commit details
    Browse the repository at this point in the history
  7. 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
    aayush-kapoor authored Feb 26, 2026
    Configuration menu
    Copy the full SHA
    2164cdf View commit details
    Browse the repository at this point in the history
  8. Version Packages (#12910)

    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] authored Feb 26, 2026
    Configuration menu
    Copy the full SHA
    97c7b9f View commit details
    Browse the repository at this point in the history

Commits on Feb 27, 2026

  1. 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>
    3 people authored Feb 27, 2026
    Configuration menu
    Copy the full SHA
    d98d9ba View commit details
    Browse the repository at this point in the history
  2. Version Packages (#12917)

    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] authored Feb 27, 2026
    Configuration menu
    Copy the full SHA
    acfa8b9 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    1330f2f View commit details
    Browse the repository at this point in the history
  4. Version Packages (#12919)

    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] authored Feb 27, 2026
    Configuration menu
    Copy the full SHA
    5ae109c View commit details
    Browse the repository at this point in the history
Loading