POST
/
files
/
{assistant_name}
# To use the Python SDK, install the plugin:
# pip install --upgrade pinecone pinecone-plugin-assistant

from pinecone import Pinecone
pc = Pinecone(api_key="YOUR_API_KEY")

# Get the assistant.
assistant = pc.assistant.Assistant(
    assistant_name="example-assistant", 
)

# Upload a file.
response = assistant.upload_file(
    file_path="/Users/jdoe/Downloads/example_file.txt",
    metadata={"published": "2024-01-01", "document_type": "manuscript"},
    timeout=None
)
{
  "name": "example-file.txt",
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "metadata": "{ 'published': '2024-01-01', 'document_type': 'manuscript' }",
  "created_on": "2023-11-07T05:31:56Z",
  "updated_on": "2023-11-07T05:31:56Z",
  "status": "Processing",
  "percent_done": 50,
  "signed_url": "https://storage.googleapis.com/bucket/file.pdf",
  "error_message": "<string>"
}
# To use the Python SDK, install the plugin:
# pip install --upgrade pinecone pinecone-plugin-assistant

from pinecone import Pinecone
pc = Pinecone(api_key="YOUR_API_KEY")

# Get the assistant.
assistant = pc.assistant.Assistant(
    assistant_name="example-assistant", 
)

# Upload a file.
response = assistant.upload_file(
    file_path="/Users/jdoe/Downloads/example_file.txt",
    metadata={"published": "2024-01-01", "document_type": "manuscript"},
    timeout=None
)
{
  "name": "example-file.txt",
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "metadata": "{ 'published': '2024-01-01', 'document_type': 'manuscript' }",
  "created_on": "2023-11-07T05:31:56Z",
  "updated_on": "2023-11-07T05:31:56Z",
  "status": "Processing",
  "percent_done": 50,
  "signed_url": "https://storage.googleapis.com/bucket/file.pdf",
  "error_message": "<string>"
}

Authorizations

Api-Key
string
header
required

Pinecone API Key

Path Parameters

assistant_name
string
required

The name of the assistant to upload files to.

Query Parameters

metadata
string

Optional JSON-encoded metadata for files.

Body

multipart/form-data
The desired file to be uploaded and processed into the assistant.
file
file
required

The file to upload.

Response

200
application/json
File upload has been accepted.

AssistantFileModel is the response format to a successful file upload request.

name
string
required
id
string
required
metadata
object | null
created_on
string
updated_on
string
status
enum<string>
Available options:
Processing,
Available,
Deleting,
ProcessingFailed
percent_done
number | null

The percentage of the file that has been processed

signed_url
string | null

A signed url that gives you access to the underlying file

error_message
string | null

A message describing any error during file processing, provided only if an error occurs.