Azure Openai can't add Assistants message content as array

Andres da Silva Santos 110 Reputation points
2024-06-20T11:34:19.0466667+00:00

Hello,

Before yesterday I was able to add a message with an array content as it shows in the OpenAI Assistants Docs, but it stopped working out of nowhere.

User's image

Now when I try to send

curl --location 'https://host.openai.azure.com/openai/threads/thread_XyWHo1TnhpomPPuFLf7OtMYH/messages?api-version=2024-05-01-preview' \
--header 'Content-Type: application/json' \
--header 'api-key: key' \
--header 'OpenAI-Beta: assistants=v2' \
--data '{
    "role": "user",
    "content": [
        {
            "type": "text",
            "text": "Create a chart from 1 to 5."
        }
    ]   
}'

I get the response

{
    "error": {
        "message": "Invalid type for 'content': expected a string, but got an array instead.",
        "type": "invalid_request_error",
        "param": "content",
        "code": "invalid_type"
    }
}
Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
2,659 questions
{count} votes