Should I use file id to retrieve file content to make a download link for annotations?

Here is documentation for retrieving code interpreter files by file id from the files endpoint, and employing the annotations API return to obtain file ids that the AI makes reference to:

https://platform.openai.com/docs/assistants/tools/reading-images-and-files-generated-by-code-interpreter

As you read, you download by file-id, which is only provided by matching the annotation to the text in the response.

Code interpreter has a short life after a thread has been run. If the user is accessing your UI by browser, I would set up a local data store, download any annotations that are received, and place them, hashed filename or directory, on an internet server drive. Then offer that link in the text response, rewriting the annotation link with the public link. That way a conversation can continue to offer working links when revisited days later.

1 Like