I’m getting "unsupported data" error when trying to send post request to Azure OpenAI. What should I do to fix the error?
https://myopenai.openai.azure.com/openai/deployments/code-davinci-002/completions?api-version=2023-03-15-preview&API-KEY=xxxxxxxxxxxx&content-type=application/json
api-version = 2023-03-15-preview
API-KEY = xxxxx
content-type = application/json
{
"model": "gpt-3.5-turbo",
"messages": [{"role": "user", "content": "Say this is a test!"}],
"temperature": 0.7
}
3
Answers
Seems like you may be mixing davinci model in your deployment but gpt model in your body.
I am experiencing a similar error when my model deployment is correct.
Using gpt-35-turbo as an Azure deployment and api-key xxxx in header and api-version 2023-03-15-preview in url string.
400 model_error
Unsupported data type.
Here is the payload.
Try to use
prompt
with ChatML instead.For example:
You are missing a
chat/
in the URL. It shouldn’t behttps://myopenai.openai.azure.com/openai/deployments/<deployment>/completions?api-version=2023-03-15-preview&API-KEY=xxxxxxxxxxxx&content-type=application/json
but
https://myopenai.openai.azure.com/openai/deployments/<deployment>/chat/completions?api-version=2023-03-15-preview&API-KEY=xxxxxxxxxxxx&content-type=application/json
I was running into the same issue and it took me forever to figure out that the endpoint for the chat API is slightly different.