@azure/openai - Additional OPTIONS request made before POST request for getChatCompletions
call
#29572
Open
2 of 6 tasks
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.
Describe the bug
A clear and concise description of what the bug is.
When calling the
getChatCompletions
function of anOpenAIClient
, an OPTIONS call to the API is made before the POST call is successfully processed.For most scenarios calling Azure OpenAI directly, this works fine. However, scenarios that implement proxies to multiple Azure OpenAI backend instances do not. This is because the OPTIONS request is not defined in the OpenAPI specification for the Azure OpenAI APIs. Those implementing the spec will not handle OPTIONS requests as is not expected.
Exploring the JS SDK, I cannot find where this request is being made as it is not clear in the OpenAI specific source that this is the case.
To confirm functionality across Azure OpenAI SDKs, the .NET SDK will only perform the POST request resulting in a successful response via a proxy.
To Reproduce
Steps to reproduce the behavior:
OpenAIClient
with default Azure OpenAI configurationOpenAIClient
using thegetChatCompletions
function.Notice that there are two requests made. The initial OPTIONS request, and the subsequent POST request.
Expected behavior
A clear and concise description of what you expected to happen.
Only the POST request should be made.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: