Backport: feat(provider/azure) : enable codeInterpreter and fileSearch for AzureOpenAI#8962
Merged
gr2m merged 1 commit intorelease-v5.0from Sep 26, 2025
Merged
Conversation
…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>
5 tasks
gr2m
approved these changes
Sep 26, 2025
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.
This is an automated backport of #8238 to the release-v5.0 branch.