This page shows you how to view a list of files, check the status of a file, and delete a file from your assistant.

This page shows you how to get a list of the files in your assistant, along with their statuses and IDs.

List files in an assistant

View all files

Use the list_files operation to get the status, ID, and metadata for each file in your assistant as in the following example:

This operation returns a response like the following:

{
  "files": [
    {
      "name": "example_file.txt",
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "metadata": {},
      "created_on": "2023-11-07T05:31:56Z",
      "updated_on": "2023-11-07T05:31:56Z",
      "status": "Processing"
    }
  ]
}

You can use the id value to check the status of an individual file.

You can list file in an assistant using the Pinecone console. Select the assistant and view the files in the Assistant playground.

View a filtered list of files

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 assistant - Filter with metadata.

The following example lists files that are a manuscript:

Additional filter examples

FilterExampleDescription
$eq{"genre": {"$eq": "documentary"}}Matches with the genre “documentary”.
$ne{"genre": {"$ne": "drama"}}Matches with a genre other than “drama”.
$gt{"year": {"$gt": 2019}}Matches with a year greater than 2019.
$gte{"year": {"$gte": 2020}}Matches with a year greater than or equal to 2020.
$lt{"year": {"$lt": 2020}}Matches with a year less than 2020.
$lte{"year": {"$lte": 2020}}Matches with a year less than or equal to 2020.
$in{"genre": {"$in": ["comedy", "documentary"]}}Matches with the genre “comedy” or “documentary”.
$nin{"genre": {"$nin": ["comedy", "documentary"]}}Matches with a genre other than “comedy” or “documentary”.
$exists{"genre": {"$exists": true}}Matches with the “genre” field.

Combine filters

The metadata filters can be combined by using $and and $or operators:

OperatorExampleDescription
$and{"$and": [{"genre": {"$eq": "drama"}}, {"year": {"$gte": 2020}}]}Matches with the genre “drama” and a year greater than or equal to 2020.
$or{"$or": [{"genre": {"$eq": "drama"}}, {"year": {"$gte": 2020}}]}Matches with the genre “drama” or a year greater than or equal to 2020.

Get the status of a file

Use the describe_file operation to get the status and metadata for your Assistant as in the following example:

This operation returns a response like the following:

{
  "name": "<string>",
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "metadata": {},
  "created_on": "2023-11-07T05:31:56Z",
  "updated_on": "2023-11-07T05:31:56Z",
  "status": "Processing"
}

You can check the status a file using the Pinecone console. In the Assistant playground, click the file for more details.

Delete a file

Use the delete file operation to delete a file.

Once a file is deleted, you cannot recover it.

You can delete a file from an assistant using the Pinecone console. In the Assistant playground, find the file and click the ellipsis (..) menu > Delete.