Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Combining a ChatCompletionsFunctionToolDefinition with an AzureCognitiveSearchChatExtensionConfiguration breaks the API #42285

Open
grankko opened this issue Feb 29, 2024 · 6 comments
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention This issue needs attention from Azure service team or SDK team OpenAI question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention This issue is responsible by Azure service team.

Comments

@grankko
Copy link

grankko commented Feb 29, 2024

Library name and version

Azure..Ai.OpenAI 1.0.0-beta.13

Describe the bug

When requesting a chat completion from an Azure OpenAI service that uses both a ChatCompletionsFunctionToolDefinition and an AzureCognitiveSearchChatExtensionConfiguration the service responds with this error (which also has spelling issues):

Functions are not supported for this API version or this model version. To learn how to user use function calling with Azure OpenAI Service. Please refer to this wiki https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/function-calling?tabs=pytho

The referenced documentation says that Supported Models include gpt-4 (1106-preview) and API version 2023-12-01-preview which we are using.

The same code works if you just remove the AzureCognitiveSearchChatExtensionConfiguration from the request.

The error message from the service makes no sense.

Expected behavior

That the service responds with http 200 and a proper ChatCompletion that can utilize both a FunctionTool and the AzureSearch extension..

Actual behavior

The services responds with 400 Bad Request and this error message:

Functions are not supported for this API version or this model version. To learn how to user use function calling with Azure OpenAI Service. Please refer to this wiki https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/function-calling?tabs=pytho

Reproduction Steps

  1. Setup an Azure Search instance and a Azure OpenAI service with a GPT deployment supporting tools / function calling
  2. Configure the ChatCompletionOptions with both Azure Search config and a self-defined FunctionToolDefintion
  3. Call the Azure OpenAI API and get a 400 bad request response

Environment

Azure, Azure OpenAI, Azure Search
Windows 11
dotnet 8

@github-actions github-actions bot added Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-triage This issue needs the team to triage. OpenAI question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Feb 29, 2024
@jsquire jsquire added Service Attention This issue is responsible by Azure service team. needs-team-attention This issue needs attention from Azure service team or SDK team and removed needs-team-triage This issue needs the team to triage. labels Feb 29, 2024
Copy link

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @jpalvarezl @trrwilson.

@grankko
Copy link
Author

grankko commented Mar 7, 2024

the issue persists in the 2024-02-15-preview version of the API and the Azure.AI.OpenAI 1.0.0-beta.14 version of the SDK

@grankko
Copy link
Author

grankko commented Mar 28, 2024

the issue persist in Azure.AI.OpenAI 1.0.0-beta.15 and 2024-03-01-preview API version.

Endpoint template in use:
https://{resourcename}.openai.azure.com/openai/deployments/{deployment}/chat/completions?api-version=2024-03-01-preview

@redvivi
Copy link

redvivi commented Apr 8, 2024

Same here using REST API.

Referencing also Azure/azure-sdk-for-js#28611

@amadas-debug
Copy link

The same issue exists if using the legacy : FunctionDefinition to make a function call as well. SDK: 1.0.0-beta.16

@ystvan
Copy link

ystvan commented May 13, 2024

Same issue exist in Azure.AI.OpenAI Version="1.0.0-beta.17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention This issue needs attention from Azure service team or SDK team OpenAI question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

5 participants