An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
I found the solution by using the api_key instead of Microsoft Entra ID credential... don't know exactly why.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Context: I am using the Azure OpenAI Responses API . My Assistant successfully used the Code Interpreter tool to generate an Excel file.
The Data: In the assistant's response, I received the following output_text containing a container_file_citation:
{
"id": "msg_xxxxxxxxxxx",
"type": "message",
"role": "assistant",
"status": "completed",
"content": [
{
"type": "output_text",
"annotations": [
{
"type": "container_file_citation",
"container_id": "cntr_xxxxxx",
"end_index": 834,
"file_id": "cfile_xxxxxxx",
"filename": "updated.xlsx",
"start_index": 804
}
],
"logprobs": [],
"text": "xxxx"
}
]
},
The Problem: I am unable to retrieve the list file of by container_id, file_id or retrieve file info/content with both container_id & file_id. I have tried the following endpoints, both resulting in 404 errors:
{
"statusCode": 404,
"error": "Not Found",
"message": "Azure OpenAI resource not found: 404 The specified entity cannot be found."
}
{
"statusCode": 404,
"error": "Not Found",
"message": "Azure OpenAI resource not found: 404 Resource not found"
}
References & Research: I have reviewed this OpenAI Community discussion regarding the retrieval of Code Interpreter files from the container. It suggests that accessing files generated in the sandbox requires utilizing a specific containers/files endpoint.
However, following these patterns in Azure OpenAI results in the 404s shown above.
Question: How do you properly download or access a file generated by the Code Interpreter in Azure OpenAI?
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
I found the solution by using the api_key instead of Microsoft Entra ID credential... don't know exactly why.
AI answer
To download a file generated by the Azure OpenAI Assistant Code Interpreter, you should ensure that you are using the correct API endpoints and parameters. Here’s a general approach:
file_id. The request should look like this:
curl https://YOUR_RESOURCE_NAME.openai.azure.com/openai/files/<YOUR-FILE-ID>/content?api-version=2024-05-01-preview \
-H "api-key: $AZURE_OPENAI_API_KEY" \
--output updated.xlsx
Make sure to replace <YOUR-FILE-ID> with the actual file_id you received in the container_file_citation.container_id and file_id you are using are valid and that you have the necessary permissions to access them. The container_id is usually associated with a specific session or context, and it may not be valid if the session has expired or if the file has been deleted.api-version=2024-05-01-preview, which should match the version you are using in your Azure OpenAI setup.purpose is set correctly to assistants so that the files are accessible by the Assistant API.If you continue to experience issues, it may be helpful to consult the Azure OpenAI documentation or community forums for specific troubleshooting steps related to your account setup.
References: