CSV upload

The csv upload route allows you to upload CSV files. It returns an ID which you can then use for categorization and similarity tasks.

Here's how you would upload a CSV:

import requests
import json
url = "https://app.pumice.ai/api/upload-csv"
files=[
('file',('file.csv',open('path/to/file.csv','rb'),'text/csv'))
]
headers = {
'KEY': '<YOUR_API_KEY>'
}
response = requests.request("POST", url, headers=headers, files=files)
print(response.json())

CSV Upload for Embeddings

If you wish to use the csv_id as an embeddings file in batch similarity route, you need to pass a for_embeddings parameter as true.

Here's an example:

import requests
import json
url = "https://app.pumice.ai/api/upload-csv"
payload={'for_embeddings': 'True'}
files=[
('file',('file.csv',open('path/to/file.csv','rb'),'text/csv'))
]
headers = {
'KEY': '<YOUR_API_KEY>'
}
response = requests.request("POST", url, headers=headers, data=payload, files=files)
print(response.json())