I printed response for run i can see ImageFileContentBlock and TextContentBlock. ImageFileContentBlock contains the file id for image. When i try to read it it’s throwing this error.
models: gpt-4-1106-preview ,gpt-4-turbo, gpt-4-turbo-2024-04-09
Tried with all same error.
The most reliable way to get AI generated files out of code interpreter is by the files endpoint using the file ID.
You can have the AI produce an annotation (called a citation when you talk to the AI about it). Then this annotation in the API return will refer to the file, and you can also replace the link in the AI response text with your own download location after you store it on your own server.
The “image file content block” is an odd way that OpenAI is either providing data or information for vision to the AI internally. If you can read it, it might be encoded in UTF-8 base64 as the file format that was created, but this isn’t something worth paying the bill to find out.
Funny enough, there’s a section of documentation you can refer to:
I am facing the same issue after creating an assistant with code interpreter in a new project. A new assistant in the default project works as expected.
Very easy to reproduce in the playground - images (charts) are not shown and the download link throws a 404.
Having the same issue with v1 as well as v2 of Assistant API, any image generated by the code interpreter using the API causes this error for me (“No such File object: file-xyz”) Tried the file retrieval endpoint but the outcome is similar. (The error message from file retrieval api{
“error”: {
“message”: “No such File object: file-xyz”,
“type”: “invalid_request_error”,
“param”: “id”,
“code”: null
}
}
Seems like an API issue, any help from the staff would be useful as this makes the large chunk of use cases from Code Interpreter useless.
Interestingly enough a similar issue occurs in the Azure AI Assistant API as well.
Hey, we’re also having the same problem. It seems like maybe the files generated by code interpreter are saving to the default project even when you’re on another project.
Thanks so much, I looked hours and hours for a solution, but couldn’t find an error in my code. Just switched to Default Projekt, created a new api key and assistant - and it works!
So, yes, I can confirm, this only happens on custom projects, not on the Default Projekt (at least it works there).
I just create an API in my default project and I still have the same problem. By the way, what about the playground? I’m having the same issue directly on the playground when generating objects like plots and pictures.
If the issue you’re encountering is that the file ID of an image file cannot be accessed through the retrieve interface, it might be worth trying to delete files on OpenAI. It’s possible that the problem is due to having too many files stored.
I faced a similar issue before, but after repeatedly using the list interface to obtain and delete files, I was able to successfully retry Code Interpreter.