feat(provider/azure) : enable codeInterpreter and fileSearch for AzureOpenAI#8238
Conversation
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
tsuzaki430
left a comment
There was a problem hiding this comment.
My own review finished. Thank you.
|
Hi @tommasoghisini and @jephal I've seen you reacting to the PR. Can you confirm that the codeInterpreter and fileSearch is working with @tsuzaki430's changes? I have trouble with my own local test environment and Azure right now. I'd like to get this shipped though 😁 |
gr2m
left a comment
There was a problem hiding this comment.
@tsuzaki430 thank you for another great pull request! Changes look great, I just need to confirm it's working as it should, or have someone else confirm.
Could you please add two examples for the Code Interpreter and File Search features? You can use https://github.com/vercel/ai/blob/861fb35ccd8557959f8804230aacca07ba9f8bd3/examples/ai-core/src/generate-text/azure.ts as a template
|
Hi @gr2m @tsuzaki430, tested locally with a generateText call and got a few errors:
|
|
Hello , dear @gr2m 😊 |
…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>
|
✅ Backport PR created: #8962 |
|
@tommasoghisini @tsuzaki430 @jephal I'm looking into creating a @vercel/ai-sdk-azure team. It would be our first community maintainer team. Would any of you be interested to help out? No expectations, it's just an experiment at this point. But the idea is that we would prioritize pull requests for the azure provider that is either created or approved by a member of the @vercel/ai-sdk-azure team |
…h for AzureOpenAI (#8962) This is an automated backport of #8238 to the release-v5.0 branch. Co-authored-by: tsuzaki430 <58161200+tsuzaki430@users.noreply.github.com> 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 , we've been using Azure OpenAI for the past 2 years and would be happy to contribute to the ai-sdk project. We're also currently using @ai-sdk/azure in our application, so I'd be glad to contribute and help improve the Azure integration as well. |
|
Hello,
Yes, maybe I can do something help. |
|
@gr2m I really like the idea. Support for the Azure provider is key for us, so I'm more than happy to help out. Thanks for putting this together! |
|
@gr2m Sounds great, Azure support for AI-sdk is very important to our team :) |
|
@rahulbhadja @tsuzaki430 you should have gotten invitations. @tommasoghisini @jephal coming soon, thank you for offering to help! |
|
Hi @gr2m , I got the invite but it's asking for Okta login that I don't have, and not able to reset pass. Can you help me with it? Thanks! |
|
Hello, |
|
Sorry for that! It's the first time that @vercel is inviting external contributors. I'll find out if we can disable the Okta login for you |
|
@gr2m |
|
great, thank you for confirming. You should all have been invited by now, and shouldn't need an Okta login. |
|
Hi @gr2m, does that include @tommasoghisini and I? I cannot see an invite anywhere |
|
Hi all, apologies but while we were able to create the @vercel/ai-sdk-azure team, it turns out we cannot add external collaborators to it. I've been thinking what else I could do to keep everyone interested in the loop. For now, I created an issue that we can utilize to communicate:
sorry not sure what happened. Can you see if https://github.com/vercel/ai/invitations works for you know? |
Background
The built-in tool 'code_interpreter' and 'file_search' are enabled on Azure OpenAI Responses API.
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.
azure.tools.codeIinterpreter build-in tool also will be 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
pnpm changesetin the project root)pnpm prettier-fixin the project root)