This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.
MIT License
5.47k
stars
4.8k
forks
source link
[BUG][C#.NETCore8] Using Azure.AI.OpenAI.Assistants API to create assistant in Azure OpenAI. #47047
When trying to create an Assistant but following error is occurring:
Azure OpenAI Retrieval v1 tool is not supported in favor of the more advanced v2 file_search tool. Please use file_search in the v2 api.
Status: 400 (Bad Request)
AssistantsClient assistantsClient = new AssistantsClient(new Uri(endpoint), new AzureKeyCredential(key));
Assistant assistant = assistantsClient.CreateAssistant(new AssistantCreationOptions(model)
{
Tools = { new RetrievalToolDefinition() },
Instructions =
"You are an assistant that looks up sales data and helps visualize the information based on user queries. When asked to generate a graph, chart, or other visualization, use the code interpreter tool to do so.",
}).Value;`
Let me know issue, I want to use Assistant/Thread/Messages/VectorStore of Azure OpenAI, as our audience is enterprise clients which want deployments in their own region, which is not possible with Open AI Service, that's why we want to use Assistants of Azure Open AI.
Waiting for response.
Thanks,
Mustafa
Expected behavior
An Assistant should be created.
Actual behavior
Exception occurring:
Azure OpenAI Retrieval v1 tool is not supported in favor of the more advanced v2 file_search tool. Please use file_search in the v2 api.
Status: 400 (Bad Request)
Library name and version
Azure.AI.OpenAI.Assistants v1.0.0-beta.4
Describe the bug
When trying to create an Assistant but following error is occurring:
Azure OpenAI Retrieval v1 tool is not supported in favor of the more advanced v2 file_search tool. Please use
file_search
in the v2 api. Status: 400 (Bad Request)Here is the code:
` using Azure; using Azure.AI.OpenAI.Assistants;
string model = "gpt-4o-mini"; string endpoint = "https://[Deployment Name].openai.azure.com/"; string key = "[Key Here]";
AssistantsClient assistantsClient = new AssistantsClient(new Uri(endpoint), new AzureKeyCredential(key));
Assistant assistant = assistantsClient.CreateAssistant(new AssistantCreationOptions(model) { Tools = { new RetrievalToolDefinition() }, Instructions = "You are an assistant that looks up sales data and helps visualize the information based on user queries. When asked to generate a graph, chart, or other visualization, use the code interpreter tool to do so.", }).Value;`
Let me know issue, I want to use Assistant/Thread/Messages/VectorStore of Azure OpenAI, as our audience is enterprise clients which want deployments in their own region, which is not possible with Open AI Service, that's why we want to use Assistants of Azure Open AI.
Waiting for response.
Thanks, Mustafa
Expected behavior
An Assistant should be created.
Actual behavior
Exception occurring: Azure OpenAI Retrieval v1 tool is not supported in favor of the more advanced v2 file_search tool. Please use
file_search
in the v2 api. Status: 400 (Bad Request)Reproduction Steps
Use code mentioned above.
Environment
We are using .NET Core 8 version