Skip to main content

Design a Function

A well-designed Function performs one task consistently. If a workflow contains several decisions, build several Functions and compose them in your pipeline.

Choose the output shape

For extraction, define an output schema via typed fields, or using a predefined schema (JSON, Pydantic, or Zod). Fields can be strings, numbers, booleans, arrays, nested objects, or nullable values.

Choose the inputs

Select every dataset column the model should see. Sutro joins multiple text columns into one input and can prefix values with their column names. Functions can be built from:
  • tabular text data;
  • collections of images or PDFs;
  • rows that combine text with image or PDF references.
Images support PNG, JPEG, and WebP. PDFs may contain up to 100 pages. Multimodal assets can be uploaded independently and run individually without any extra configuration.
Advanced: Assets can also be referenced within datasets as columns, allowing you to configure more advanced inputs that interleave multiple assets and modalities into a single input.
Enable web search when the correct decision requires current external information. Models may use search while generating predictions during the Function-building loop. This capability does not carry into the Batch inference API. A Function run through Batch cannot search the web or call tools.

Start with the decision, not the prompt

Write the task as you would explain it to a new teammate in one or two sentences. Avoid enumerating every edge case before the first iteration. The review loop turns your rationales and corrections into the detailed prompt.