File purpose: assistant vs. assistants_output

In the api reference for Files->purpose

In the field description, it states: The intended purpose of the file. Supported values are fine-tune, fine-tune-results, assistants, and assistants_output.

I can not find anywhere in the docs, api or this forum where it defines what “assistants_output” is or how it’s used.

What’s the difference between “assistants” vs. “assistants_output”?

Sure: The AI within assistants can produce files using tools (it used to make more files when the retrieval tool would quote sections of documents). Here is an example of generating one using assistants in the playground:

Untitled

Then we get a listing of files with that purpose:

== Assistants file utility ==
[1] Upload file
[2] List all files
[3] List all and delete one of your choice
[4] Delete all assistant files (confirmation required)
[9] Exit
Enter your choice: 2
/mnt/data/randoms.txt [file-EhkRXPaPKsQNw4bewdQ38Wxb], Created: 2024-04-26

The purpose has a novel use when used as metadata: we can run a process that will list just those, and clean up old and forgotten ones after a while.

response = client.files.list(purpose="assistants_output")

(a demonstration costing $0.03 a day for using their code interpreter instead of one you wrote…)

So are you saying that when the assistant generates a file, it then automatically sets the ‘purpose’ field to ‘assistants_output’? With the reason being that it can then be used later, by my code, as a query parameter, to retrieve a list of files using that as a query parameter?

You can get a list of all that have been AI-generated that are in the file store, but they won’t have any metadata about where they came from. Management then becomes important.

If you have dozens of people using code interpreter, then you’ll want to have those interactions be through a central endpoint and database so you can retrieve the linked files to your own store and replace links.

Do you want users to see download links come from "https://fileserviceuploadsperm.blob.core.windows.net/files/file-EhkRXPaPKsQNw4bewdQ38Wxb?se=2024-04-27T21%3A02%3A54Z&sp=r&sv=2021-08-06&sr=b&rscc=max-age%3D299%2C%20immutable&rscd=attachment%3B%20filename%3Drandoms.txt&sig=RsIzrFSIuuLgeWAXeIsqBuFXuZ4mjBwOJ3Q%2BMYY/Og%3D

(yes, that’s what is provided as a non-API download location; I shuffled some URL digits in case it leaks info.