AI classify and extract
Settings, outputs and examples for the AI classify and AI extract steps, and the limits administrators set.
Both steps need an AI connection and something to read: Text, such as OCR text or a template with the file's name, an Image from a Load content step, or both. Add each with Add text input or Add image input. An image needs a model that takes images. Only the text and image you add are sent; nothing else from the file is.
Selecting either step shows a summary in the inspector, such as the connection, model, inputs and categories. Configure step, Edit beside a section, or double-clicking the step opens the larger editor:
- Configuration: Model (the connection and model side by side), the inputs (What should be classified? or What information should be analyzed?) and the step's task: its categories or its values.
- Advanced: Additional instructions and Generation settings, then Execution.
- Outputs and Test.
Model
Choose a Connection, or add one from the same list. Model starts at Connection default, with the model that means underneath, such as llama3.2:latest; choose another to use it for this step only. The information button beside it shows what the model is known to support. When the model can't take something the step needs, such as an image, a warning says so under the picker; when it's unknown, the warning says that instead. Tessra never clears an input because the model changed.
Model checks
Before you test or publish, Tessra checks the model each AI step will use (the one you chose, or the connection's default) against what the step needs: image input when an Image is set, and structured output or JSON mode when Require structured output is on. A step whose connection doesn't offer the kind of model its Method uses can't be published either.
- When the model is known not to support it, that's an error, and testing and publishing stop until you choose another model or change the step.
- When it's not known either way, that's a warning. You can still test; Tessra tries the feature and reports what happened. Mark the feature under the connection's model features to settle it.
- When the connection has no default model and the step names none, that's an error.
The step never switches to another model by itself, and never sends an image you didn't choose.
AI classify
Chooses the best matching category for an image or text. Define the possible categories, and the AI chooses the one that best matches. Categories are possible answers, not folders or tags: the step only answers, and later steps act on the answer.
The categories are a table: Category and What belongs in this category?, such as Fruit and Fruits such as apples and oranges. Add category adds a row, and each row's menu moves it up or down or removes it. Names can't be empty or repeat. When a later step compares against a category you remove, Tessra asks first; it never changes that step for you. Below the table, an illustrative example shows how an answer maps to a category; it isn't a real result.
On the canvas, the step shows its category names, such as Fruit, Vegetable.
fruit. Later steps match on the id, and it stays the same when you rename the category, so renaming never breaks them. The editor doesn't show the ids; the Outputs tab shows how to refer to the answer.matched is false. When off, it must choose a category. A decision model gets an extra option, None of the other categories fits.Produces: category (the id, empty when nothing fits), label, matched, confidence, probabilities, reason and ai (the run record, with method set to decision or language).
- With a decision model,
confidenceis the chosen category's probability,probabilitieshas every category's probability by id (and_nonefor no match), andreasonis empty. - With a language model,
confidenceis the model's own estimate from 0 to 1, not a measured probability,probabilitiesis empty, andreasonis one sentence.
For example, when a decision model picks Receipts, the step returns:
{ "category": "receipts", "label": "Receipts", "matched": true, "confidence": 0.93, "probabilities": { "receipts": 0.93, "screenshots": 0.05, "_none": 0.02 }, "reason": null }
A language model returns a reason instead:
{ "category": "receipts", "label": "Receipts", "matched": true, "confidence": 0.92, "probabilities": null, "reason": "It shows a shop name, items and a total paid." }
A Switch on steps.<id>.category with one case per category id sends each kind of file its own way; its Otherwise port catches the files nothing fits.
AI extract
Reads typed values, such as a receipt's total and date, from an image or text. It only reads them: add a Save file or Set field step to store them.
The values are a table: Value, Type, Required and Description. Add value adds a row; Use existing fields adds one per custom field, with a matching type, ready to write back with Save file. Below the table, an illustrative example shows the shape of the result, such as Total: 48.72.
On the canvas, the step shows its value names, such as Merchant, Total, Purchase date.
purchaseDate. The key names the output, and it stays the same when you rename the value. Values added before names existed show their key as the name.The types are Text, Number, Whole number, Yes or no, Date (YYYY-MM-DD) and List of text.
Produces: one output per value, named by its key, plus missing (the keys that weren't found), confidence (each value's confidence by key, from 0 to 1, from an extraction model; empty for a language model) and ai. The keys missing, confidence and ai can't be used.
An extraction model reads dates written without a year against the day the step runs.
The model is told to leave out what it can't find instead of guessing, and Tessra never fills a value in: an empty answer, or a date that isn't a real YYYY-MM-DD date, counts as not found. A value that isn't found is empty and listed in missing. When it's Required, the step fails with ai_required_missing instead, so the run stops before later steps use a gap.
Generation settings
These are under Generation settings on the Advanced tab. Empty settings show Use connection default. Decision and extraction models take only Max input characters and When text is too long:
| Setting | |
|---|---|
| Temperature | From 0 to 2. Empty uses the connection's setting. Left out for models that don't take it, which the run notes. |
| Max output tokens | The longest answer. Empty uses the connection's setting, then 1,024. |
| Max input characters | The most text to send. Empty uses the connection's setting, then the server's limit. |
| When text is too long | Fail the step (the default) stops with ai_input_too_large. Send only the start sends only the first characters and records inputTruncated in the run. |
| Require structured output | Fail when the model is known not to support structured output, instead of checking a looser answer. See How answers are checked. |
Server limits
Administrators set upper bounds under Tessra:Plugins:tessra.ai in the server configuration, for example with the environment variable Tessra__Plugins__tessra.ai__MaxOutputTokens=8192. A step or connection asking for more fails with ai_limit_exceeded.
| Setting | Default | Controls |
|---|---|---|
MaxOutputTokens | 4096 | The most output tokens any request may ask for |
MaxInputCharacters | 16000 | The most text characters any request may send |
MaxImageBytes | 10 MiB | The largest image a step may send |
DefaultOutputTokens | 1024 | Output tokens when neither the step nor the connection sets them |
Errors
| Code | Means |
|---|---|
ai_model_missing | Neither the step nor the connection names a model. For decision and extraction steps, the connection's default model for that kind counts. |
ai_model_wrong_kind | The step uses a decision or extraction model, but the connection's model list says the chosen model is another kind. Nothing was sent. |
ai_model_unavailable | The provider doesn't know the model (404). Check its name in the model picker. |
ai_model_missing_feature | The model is known not to support something the step needs, such as images or, with Require structured output, structured output. Nothing was sent. |
ai_input_too_large | The text is over the step's, connection's or server's character limit, or the image is over the size limit. |
ai_input_unsupported | The image isn't PNG, JPEG or WebP. |
ai_limit_exceeded | A setting asks for more than the server allows. |
ai_invalid_output | The answer didn't fit the expected shape, twice. |
ai_output_truncated | The answer hit the output token limit. Raise Max output tokens. |
ai_refused | The model or the provider's filter refused to answer, or a decision model declined the question. The run shows its explanation when there is one. |
input_invalid | A decision step sent an image through the System One API, which takes text only, or an extract step sent more than 4 images to an extraction model, or an image OpenRouter doesn't take (only PNG, JPEG and WebP). |
ai_required_missing | A required value wasn't found. |
Connection problems use the usual codes, such as connection_auth_failed and provider_throttled; see Errors in runs.