> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sutro.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Design a Function

> Choose a narrow decision, output shape, and representative dataset.

# 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

| Type                        | Use it when                                   | Example                                 |
| --------------------------- | --------------------------------------------- | --------------------------------------- |
| Judge                       | The answer depends on a rubric or quality bar | Did the agent resolve the issue?        |
| Binary classification       | The output is `true` or `false`               | Is this lead qualified?                 |
| Single-label classification | Exactly one custom label applies              | Which team owns this ticket?            |
| Multi-label classification  | Several labels may apply                      | Which policies does this trace violate? |
| Structured extraction       | The output is a typed object                  | Extract parties, dates, and obligations |

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.

<Tip>
  **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.
</Tip>

## Using tools and web search

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.
