Skip to content

Backport: feat(provider/azure) : enable codeInterpreter and fileSearch for AzureOpenAI#8962

Merged
gr2m merged 1 commit intorelease-v5.0from
backport-pr-8238-to-release-v5.0
Sep 26, 2025
Merged

Backport: feat(provider/azure) : enable codeInterpreter and fileSearch for AzureOpenAI#8962
gr2m merged 1 commit intorelease-v5.0from
backport-pr-8238-to-release-v5.0

Conversation

@vercel-ai-sdk
Copy link
Copy Markdown
Contributor

@vercel-ai-sdk vercel-ai-sdk bot commented Sep 26, 2025

This is an automated backport of #8238 to the release-v5.0 branch.

…eOpenAI (#8238)

## Background

The built-in tool 'code_interpreter' and 'file_search' are enabled on
Azure OpenAI Responses API.


tool/provider | OpenAI | Azure OpenAI
-- | -- | --
web_search | ✅ Enabled | ❌ Not currently supported
code_interpreter | ✅ Enabled | ✅ Enabled
file_search | ✅ Enabled | ✅ Enabled

note : currently, web_search is not supported in Azure OpenAI provider.

https://learn.microsoft.com/en-us/azure/ai-foundry/openai/how-to/responses?tabs=python-secure#model-support

## Summary
Azure provider's code_interpreter and file_search is enabled same as
openai provider.
openai's tools code_interpreter and file_search are added to internal
export (packages/openai/src/internal/index.ts).
And azure's tools get the implementations from import openai provider's
tools.

azure.tools.fileSearch build-in tool will be available.

``` typescript
const result = await generateText({
  model: azure.responses('gpt-4.1-mini'),
  prompt: 'What does the document say about user authentication?',
  tools: {
    file_search: azure.tools.fileSearch({
      // optional configuration:
      vectorStoreIds: ['vs_123', 'vs_456'],
      maxNumResults: 10,
      ranking: {
        ranker: 'auto',
      },
    }),
  },
  // Force file search tool:
  toolChoice: { type: 'tool', toolName: 'file_search' },
});
```

azure.tools.codeIinterpreter build-in tool also will be available.
``` typescript
const result = await generateText({
  model: azure.responses('gpt-4.1-mini'),
  prompt: 'Write and run Python code to calculate the factorial of 10',
  tools: {
    code_interpreter: azure.tools.codeInterpreter({
      // optional configuration:
      container: {
        fileIds: ['assistant-123', 'assistant-456'], // optional file IDs to make available
      },
    }),
  },
});
```

## Manual Verification on Azure
✅code_interpreter works.
✅code_interpreter with fileIds "assistant-" prefix files.
✅file_search works is "vs_" vector store.
✅both openai and azure providers , I tried same test and get almost the
same result.

## Others
I met the file_search zod parse error on openai and azure provider both
environments.
#8030 (comment)
When it will be fixed on openai , I think azure's tool will be fixed ,
too.

## Tasks
- [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] Formatting issues have been fixed (run `pnpm prettier-fix` in the
project root)
- [x] I have reviewed this pull request (self-review)

---------

Co-authored-by: tsuzaki430 <tsuzaki430@users.noreply.github.com>
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
Co-authored-by: Gregor Martynus <39992+gr2m@users.noreply.github.com>
@gr2m gr2m enabled auto-merge (squash) September 26, 2025 18:34
@gr2m gr2m merged commit 0bda600 into release-v5.0 Sep 26, 2025
12 checks passed
@gr2m gr2m deleted the backport-pr-8238-to-release-v5.0 branch September 26, 2025 18:35
@gr2m gr2m added ai/provider related to a provider package. Must be assigned together with at least one `provider/*` label provider/azure Issues related to the @ai-sdk/azure provider provider/openai Issues related to the @ai-sdk/openai provider labels Oct 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai/provider related to a provider package. Must be assigned together with at least one `provider/*` label provider/azure Issues related to the @ai-sdk/azure provider provider/openai Issues related to the @ai-sdk/openai provider

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants