
azure-openai
#10033
model_operation_error
The specified model is incompatible with the chosen operation. Please select a different model and try again. Learn more about compatible models with operations here: https://go.microsoft.com/fwlink/?linkid=2197993.
This error has been identified and solved.
Reason
The 400 status error in the Azure OpenAI API, specifically the error message indicating that the chatCompletion
operation does not work with the text-embedding-ada-002
model, is due to several key reasons:
Incorrect Model Usage
The text-embedding-ada-002
model is not compatible with the chatCompletion
operation. This operation only supports specific models, such as gpt-3.5-turbo
and gpt-3.5-turbo-0301
, and not text embedding models.
API Request Configuration
The error could also be a result of an incorrectly configured API request. This includes issues such as invalid or missing required properties in the request payload, incorrect headers, or an incorrect base URL.
Model and Operation Compatibility
The specified model (text-embedding-ada-002
) is designed for embedding tasks and is not suitable for chat completion operations, which require different types of models.
Solution
To fix the 400 status error in the Azure OpenAI API, you need to address the following issues:
Use a compatible model: Switch to a model that is supported for the
chatCompletion
operation, such asgpt-3.5-turbo
orgpt-3.5-turbo-0301
.Ensure correct API request configuration: Verify that your request payload, headers, and base URL are correctly configured.
Check the request payload structure: Make sure the
messages
array and other required properties in the request body are properly formatted.
Here are the key actions to take:
Change the model to
gpt-3.5-turbo
orgpt-3.5-turbo-0301
.Review and correct the API request payload and headers.
Validate the base URL and API version used in the request.
Suggested Links
https://portkey.ai/error-library/prompt-error-10016
https://github.com/langchain-ai/langchain/issues/6363
https://cheatsheet.md/chatgpt-cheatsheet/openai-api-error-axioserror-request-failed-status-code-400
https://community.openai.com/t/embeding-model-has-trouble/318117
https://learn.microsoft.com/en-us/answers/questions/1479386/azure-openai-api-calling-issue
https://community.openai.com/t/azure-openai-embeddings-vs-openai-embeddings/86231
https://community.openai.com/t/azure-open-ai-assistant-api-connection-error/662198
https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/openai/azure-ai-openai/TROUBLESHOOTING.md