An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
Hello Dariusz !
Thank you for posting on Microsoft Learn.
Although the expires_after parameter isn't supported for assistant-purpose file uploads, you can apply expiration when creating or updating vector stores, which are used by the file_search tool.
vector_store = client.beta.vector_stores.create_and_poll(
name="Product Documentation",
file_ids=['file_1','file_2'],
expires_after={
"anchor": "last_active_at",
"days": 7
}
)
This sets the vector store to expire 7 days after its last activity.
https://learn.microsoft.com/en-us/azure/ai-foundry/openai/how-to/file-search
Uploads made through assistant messages into threads automatically have a default expiration of seven days after last activity, even without specifying expires_after. You can override these settings only by managing vector stores explicitly.
If controlling file expiration is essential, you could:
- upload your files via purpose=assistants for use with your assistant
- individually create a vector store attaching the same file(s), and specify an expires_after policy there attach that vector store to your assistant or thread as needed, allowing you to leverage expiration control