In Azure OpenAI Studio I am hoping to use Assistants to do data analysis, however, I need to know where those files are stored and how to delete them. When I click on add files I am offered the chance to use an already uploaded file. If I delete previously made assistants then the file remains.
Where are these files being uploaded to and how can I:
I've tried searching the documentation on assistants but it only references files used in threads, not where they are stored. I also tried deleting assistants to see if files uploaded to them get deleted too but they don't.
Edit:
@Sampath I uploaded files from the playground under Assistants. When I click on Add Files I see previously uploaded files. I didn't follow a reference I just used the tool as I would the chatGPT interface from openAI.
Usually, files appear in the Data files
tab. Sometimes, due to region restrictions, they don't appear.
So, there is no direct way to delete those files in the portal, but you can use the Python SDK or REST to delete
them.
Below are the files I have in the existing files.
The same files are listed when using the Python SDK.
import os
import json
from openai import AzureOpenAI
client = AzureOpenAI(
api_key="bb286...............",
api_version="2024-02-15-preview",
azure_endpoint = "https://<openai_name>.openai.azure.com/"
)
for i in client.files.list():
print(i)
Output:
Whenever you create a file, a file_id
is automatically generated, and you can use that ID for various operations.
To delete a file, use the code below.
client.files.delete('file_id')
Afterward, refresh the portal page to see the changes.
Next, to manage access, you need to restrict access to the Azure OpenAI resource itself, either by api key
or in IAM
. However, you cannot restrict access only to those files.