Initiate a batch upload
datasets.upload.initiate_batch(UploadInitiateBatchParams**kwargs) -> UploadInitiateBatchResponse
POST/api/v1/datasets/upload/initiate-batch
Initiate a batch upload. A batch must be homogeneous: either all document formats (pdf, docx, pptx, xlsx, html, zip) or all tabular formats (csv, json, jsonl, parquet). Mixed batches are rejected. TXT files are permissive and may be included in either kind of batch (or alone, in which case the dataset is tabular); their contents are converted during complete-batch.
Initiate a batch upload
import os
from adaption import Adaption
client = Adaption(
api_key=os.environ.get("ADAPTION_API_KEY"), # This is the default and can be omitted
)
response = client.datasets.upload.initiate_batch(
name="my-document-dataset",
files=[{
"file_name": "report.pdf",
"file_format": "pdf",
"file_size_bytes": 1048576,
}],
)
print(response.dataset_id){
"dataset_id": "dataset_id",
"uploads": [
{
"file_name": "file_name",
"upload_url": "upload_url",
"s3_key": "s3_key"
}
]
}Returns Examples
{
"dataset_id": "dataset_id",
"uploads": [
{
"file_name": "file_name",
"upload_url": "upload_url",
"s3_key": "s3_key"
}
]
}