# To use the Python SDK, install the plugin:# pip install --upgrade pinecone pinecone-plugin-assistantfrom pinecone import Pineconepc = Pinecone(api_key="YOUR_API_KEY")# Get your assistant.assistant = pc.assistant.Assistant( assistant_name="example-assistant", )# List files in your assistant.files = assistant.list_files()
This operation returns a response like the following:
Metadata filter expressions can be included when listing files. This will limit the list of files to only those matching the filter expression. Use the filter parameter to specify the metadata filter expression.For more information about filtering with metadata, see Understanding files.The following example lists files that are a manuscript:
# To use the Python SDK, install the plugin:# pip install --upgrade pinecone pinecone-plugin-assistantfrom pinecone import Pineconepc = Pinecone(api_key="YOUR_API_KEY")# Get your assistant.assistant = pc.assistant.Assistant( assistant_name="example-assistant", )# List files in your assistant that match the metadata filter.files = assistant.list_files(filter={"document_type":"manuscript"})
# To use the Python SDK, install the plugin:# pip install --upgrade pinecone pinecone-plugin-assistantfrom pinecone import Pineconepc = Pinecone(api_key="YOUR_API_KEY")# Get an assistant.assistant = pc.assistant.Assistant( assistant_name="example-assistant", )# Describe a file. # To get a signed URL in the response, set `include_url` to `True`.file = assistant.describe_file(file_id="3c90c3cc-0d44-4b50-8888-8dd25736052a", include_url=True)
This operation returns a response like the following:
signed_url provides temporary, read-only access to the relevant file. Anyone with the link can access the file, so treat it as sensitive data. Expires in one hour.
You can check the status a file using the Pinecone console. In the Assistant playground, click the file for more details.
This feature requires API version2026-04 or later.
File uploads, upserts, and deletes are asynchronous. Each action returns an operation object that you can poll for status and progress.Use List operations and Describe an operation for the HTTP API. Example requests:
Operation status values include Processing (use percent_complete for progress), Completed, and Failed (the response may include error_message). The percent_complete field on operations replaces percent_done on the file model; ingestion usage for completed file work may appear as ingestion_units on the operation.
# To use the Python SDK, install the plugin:# pip install --upgrade pinecone pinecone-plugin-assistantfrom pinecone import Pineconepc = Pinecone(api_key="YOUR_API_KEY")# Get your assistant.assistant = pc.assistant.Assistant( assistant_name="example-assistant", )# Delete a file from your assistant.assistant.delete_file(file_id="3c90c3cc-0d44-4b50-8888-8dd25736052a")
Once a file is deleted, you cannot recover it.
With API version2026-04 or later, delete is asynchronous and returns an operation ID. You can track file operations to monitor progress. On older API versions, you can delete a file while it is still processing without waiting for completion.
You can also delete a file from an assistant using the Pinecone console. In the Assistant playground, find the file and click the ellipsis (…) menu > Delete.
This feature requires API version2026-04 or later.
File uploads, upserts, and deletes are asynchronous operations. Each of these actions returns an operation object that you can poll for status and progress.
Processing: The operation is in progress. Use percent_complete to track progress.
Completed: The operation finished successfully.
Failed: The operation failed. In this case, the operation response includes error_message.
The percent_complete field on operations replaces the percent_done field that was previously on the file model. Similarly, error_message appears on failed operations, not on the file model.