files are not talked about like “do you have the file” when you have a vector store.
Instead what you must have enabled in the assistant is file_search tool, and if the files are part of the permanent purpose of the assistant, then the vector store should be attached to the assistant id with create or modify assistant.
Then the tool name that is actually presented to the AI is myfiles_browser
. It has a search method. It is best if your assistant instructions tell the AI what it doesn’t know and therefore must perform a search on, and also what information is actually behind the file search as part of its operations. You must counter some stupid instructions accompanying the tool that there are “user uploaded” files with your own instructions.
The search return is chunks of documents by similarity to the search results. You therefore cannot ask questions like “summarize the entire dog grooming article”.
There are methods to investigate the files previously added to a store:
GET https://api.openai.com/v1/assistants/{assistant_id}
Return assistant object. Must have both tools: type->file_search, and tool_resources->file_search->vector_store_ids from which you can obtain connected vector stores.
List vector store files
get https://api.openai.com/v1/vector_stores/{vector_store_id}/files?limit=100
Complete listing. You must use more query terms besides limit if you get 100 file results indicating there may be more, then needing pagination through multiple calls.
GET https://api.openai.com/v1/vector_stores/{vector_store_id}/associations?limit=10
Undocumented, returns objects that have the store connected, with thread objects or assistant objects. (might be session key only, since you can reverse to thread ids)
GET https://api.openai.com/v1/assistants_models
Like the models endpoint, but returns whether retrieval (nee file_search) can be used with each model. So you can block yourself from using the wrong model.