Skip to content
SupportLogin

Initiate a dataset upload

datasets.upload.initiate(UploadInitiateParams**kwargs) -> UploadInitiateResponse
POST/api/v1/datasets/upload/initiate

Initiate a dataset upload

ParametersExpand Collapse
name: str

Human-readable name for the dataset

file_format: Literal["csv", "json", "jsonl", 8 more]

Format of the file being uploaded

One of the following:
"csv"
"json"
"jsonl"
"parquet"
"pdf"
"docx"
"pptx"
"xlsx"
"html"
"zip"
"txt"
ReturnsExpand Collapse
class UploadInitiateResponse:
upload_url: str

Pre-signed S3 URL — upload the file directly to this URL via HTTP PUT

Initiate a dataset 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(
    name="my-training-data",
    file_format="csv",
)
print(response.upload_url)
{
  "upload_url": "https://s3.amazonaws.com/bucket/key?X-Amz-Signature=..."
}
Returns Examples
{
  "upload_url": "https://s3.amazonaws.com/bucket/key?X-Amz-Signature=..."
}