Skip to main content

Functions

Use batch_run_function() for tables, local files, or signed HTTP(S) URLs. Retry-safe S3 submission is an optional mode of this same method. The CLI manages S3 signing, receipts, watching and file downloads when you want an end-to-end command.
The published Function supplies its prompt, model, schema, and sampling defaults. Extra row fields are ignored, optional fields may be absent, and text values are converted to strings. Typed image and PDF fields keep their media. batch_run_function() returns a job ID, or None if submission fails. For large results, use download_job_results().

Retry-safe S3 submission

Supply a signed S3 HTTPS GET URL and its pinned identity with a persisted UUID. The deployment must advertise resumable submission support. The SDK has the server validate the request against the persisted key, waits for ingestion acceptance, and returns the original job ID. It creates no receipt files and does not watch execution or download results automatically.
Reuse the same key, owner, object identity and request options after a lost response, interruption or timeout. Only the signed URL may be refreshed; never generate a replacement key just to retry. A retry after acceptance recovers the job ID without downloading the source again. CSV, Parquet and JSONL are supported in this mode; dry_run and stay_attached are unavailable. Like ordinary submission, this returns None on a submission failure or wait timeout and prints a safe error. Inspect a terminal failure before deliberately starting a corrected request with a new key. See the submission states and source identity contract. Use the existing job methods to monitor and retrieve results after acceptance; the job ID is independent of local output paths. To run a single input and wait for the answer, use run_function().

Image and PDF inputs

Image and PDF Functions run in Batch when their selected native vision model and deployment advertise that support. Native PDF Functions use Qwen3.5 or Gemma 4 vision models. Use the same Image and Asset values as run_function():
The SDK uploads inline image and PDF bytes once per content digest. Use Asset.from_bytes(pdf_bytes, "application/pdf") for PDF bytes already in memory. HTTPS sources and assets already uploaded to the Function also work. Remote CSV asset columns may contain HTTPS URLs or exact stored asset names from that Function’s collection. Assets are retained when the job is accepted so later inference and review use those bytes. Native Batch ingestion accepts PNG, JPEG, and WebP images up to 20 MiB each through HTTPS URLs or raw image data URI strings. Inline image helpers such as Image.from_bytes() and Image.from_path() upload images through the SDK and are limited to 5 MiB each. Harmonize dataset or Function collection images also have a 5 MiB limit, including review reimports. Use Image.from_url() for Batch images larger than 5 MiB. Native PDFs must be unencrypted and at most 32 MiB each. The server renders PDFs into page images with extracted text and page numbers, using the same representation as real-time Functions. Each row is limited to eight images total, counting every PDF page and every separate image. Inputs exceeding the page or model-context limit are rejected rather than truncated. Web search and tool calls remain unavailable in Batch. Encrypted PDFs and XFA forms are unsupported; export XFA forms to standard PDFs first. Documents exceeding preprocessing resource limits, including one million extracted characters per PDF, are rejected without truncation.