Azure OpenAI Assistants - thread.run.failed generating image with Code Interpreter

Andres da Silva Santos 115 Reputation points
2024-06-02T12:53:01.32+00:00

I'm always getting a thread.run.failed when trying to generate an image with code_interpreter.

Model: gpt-4o

Api-version: 2024-05-01-preview

Adding the message to the thread:

curl --location 'https://host.openai.azure.com/openai/threads/thread_DfO71OLrFVH9BkC5Yqbqfwoz/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."
        }
    ]
}'
{
    "id": "msg_fdmHnjdBwkjwSiKFJmtnVnZE",
    "object": "thread.message",
    "created_at": 1717332036,
    "assistant_id": null,
    "thread_id": "thread_DfO71OLrFVH9BkC5Yqbqfwoz",
    "run_id": null,
    "role": "user",
    "content": [
        {
            "type": "text",
            "text": {
                "value": "Create a chart from 1 to 5.",
                "annotations": []
            }
        }
    ],
    "attachments": [],
    "metadata": {}
}

Running the assistant:

curl --location 'https://host.openai.azure.com/openai/threads/thread_DfO71OLrFVH9BkC5Yqbqfwoz/runs?api-version=2024-05-01-preview' \
--header 'Content-Type: application/json' \
--header 'api-key: key' \
--header 'OpenAI-Beta: assistants=v2' \
--data '{
    "assistant_id": "asst_GQA8pjIdp1HUIhS1mxz3OxoJ",
    "stream": true
}'

{
 "id": "run_2RgKUGBwewFln7r9AEmiSEN5",
"object": "thread.run",
"created_at": 1717332052,
"assistant_id": "asst_GQA8pjIdp1HUIhS1mxz3OxoJ",
"thread_id": "thread_DfO71OLrFVH9BkC5Yqbqfwoz",
"status": "failed",
"started_at": 1717332053,
"expires_at": null,
"cancelled_at": null,
"failed_at": 1717332061,
"completed_at": null,
"required_action": null,
"last_error": {
"code": "server_error",
"message": "Sorry, something went wrong."
 },
"model": "gpt-4o",
"instructions": "You are a data analyst.",
"tools": [
 {
"type": "code_interpreter"
 }
 ],
"tool_resources": {
"code_interpreter": {
"file_ids": []
 }
 },
"metadata": {},
"temperature": 1.0,
"top_p": 1.0,
"usage": {
"prompt_tokens": 2711,
"completion_tokens": 101,
"total_tokens": 2812
 },
"response_format": "auto",
"tool_choice": "auto"
}

Notice the message

"last_error": {"code": "server_error","message": "Sorry, something went wrong."}

This seems to be the same issue that was reported on the community.openai https://community.openai.com/t/run-failed-sorry-something-went-wrong-error-while-sending-an-image/775989

Apparently OpenAI solved the issue but the error persists through Azure API.

Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
3,132 questions
{count} vote

Accepted answer
  1. navba-MSFT 24,795 Reputation points Microsoft Employee
    2024-06-26T09:27:04.68+00:00

    @Andres da Silva Santos Apologies for the late reply. We appreciate your patience on this.

    .

    The fix for this issue has been deployed to East US and East US 2 region. This should have addressed this issue.

    .

    Please confirm if you are still encountering this issue. I would be happy to assist you further.

    .

    **

    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.