Reaccessing files uploaded when creating an assistant

After I create an assistant and upload files to it, I am able to retrieve (access) the assistant. But how do I also access the files which I uploaded?

You cannot download the files that are provided to an assistant.

Not allowed to download files of purpose: assistants

Only “purposes” that are for output files can be obtained by download, which is:

from openai import OpenAI
client = OpenAI()
content = client.files.content(file_id_string)

This ensures organization members cannot spy on files that may be user message attachments, from other org members or clients, similar to how thread listing is prohibited by API key.

1 Like

by accessing the files i do not mean downloading them but accessing them in the cloud. the context here is when i re-access (reuse) the assistant.

In the course of conversing with assistants, you can receive file citations based on the index of file ids in the vector store. The implementation is under continuing changes and various states of useless with file search.

please show the forum a script which makes clear what you are talking about. python preferred, of course.

I’ll show the API reference, where I’ve clicked “expand” half-a-dozen times.

The annotations component is extracted from special citation language the AI has produced in the user response.

You might get a file_citation and a file_id. Or this new output which appeared in the latest API spec and latest Python version might continue to be non-functional and return a useless file_id. The expectation might be that it returns the chunk contents as the AI can no longer mark passages to cite like it could with retrieval. Assistants is something I am quite over with to go be an alpha tester and produce the missing documentation.

You ask a question, and I’m probably providing poor answers, when there is likely a bigger question framing it, like “how do I completely backup an assistant from the API”.