i will entegrate my project with assistant api and i want to know that would it be neccesarry to keep files or messages that user will send to assitant api in case that openai deleted all messages or files.
i will use the v2 version of the assistant.
Any knowledge about it?
The vector stores created using thread helpers (like tool_resources.file_search.vector_stores in Threads or message.attachments in Messages) have a default expiration policy of 7 days after they were last active (defined as the last time the vector store was part of a run).
When a vector store expires, runs on that thread will fail. To fix this, you can simply recreate a new vector_store with the same files and reattach it to the thread.
all_files = list(client.beta.vector_stores.files.list("vs_expired"))
vector_store = client.beta.vector_stores.create(name="rag-store")
client.beta.threads.update(
"thread_abc123",
tool_resources={"file_search": {"vector_store_ids": [vector_store.id]}},
)
for file_batch in chunked(all_files, 100):
client.beta.vector_stores.file_batches.create_and_poll(
vector_store_id=vector_store.id, file_ids=[file.id for file in file_batch]
)
Based on the above code from docs, it looks like the files will still be on the OpenAI cloud storage, so no need to store unless you want to consume those files in some other manner outside the API.
For the vector stores, the answer of @sps is quiete eligible.
But i had some confusion about code interpreter and files endpoints, as well as messages in assistant api. I found https://platform.openai.com/docs/models/default-usage-policies-by-endpoint in this section, it says that: Objects related to the Assistants API are deleted from our servers 30 days after you delete them via the API or the dashboard. Objects that are not deleted via the API or dashboard are retained indefinitely.