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.