> For the complete documentation index, see [llms.txt](https://typless.gitbook.io/typlessapi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://typless.gitbook.io/typlessapi/typless/document-type/descriptions-and-presets.md). Agents can also search and read this documentation through its [MCP server](https://typless.gitbook.io/typlessapi/~gitbook/mcp).

# Descriptions and presets

How descriptions and presets steer pretrained models

Pretrained models extract what you describe. Instead of training them with examples, you tell them in plain language what the documents are, what each field holds and how special suppliers write their documents. Presets add a second layer: they tell Typless what kind of value a field is, so it can locate, clean up and validate it.

| Setting                          | Where you set it                                      | Applies to                          |
| -------------------------------- | ----------------------------------------------------- | ----------------------------------- |
| Description                      | Document type form, ***Basic info***                  | Every document of the document type |
| Field description                | Each metadata and line item field                     | One field                           |
| Description for line item fields | Document type form, above ***Line item fields***      | The line items table                |
| Supplier description             | ***Models*** → model actions → ***Edit description*** | Documents of one supplier           |
| Preset                           | Each metadata and line item field                     | One field                           |

Descriptions are used only by document types with a [pretrained model](https://typless.gitbook.io/typlessapi/typless/document-type/model-type.md). Trainable models ignore them; for trainable document types a preset only fills in the field's name and data type.

## Document type description

The ***Description*** in ***Basic info*** tells the model what kind of documents it reads, for example *Invoices from different suppliers.* or *Delivery notes that come with our goods deliveries.* Keep it to one or two sentences about the documents, not about single fields.

## Field descriptions

Every field of a pretrained document type has a description. It is required, and it is what the model looks for on the document, so write it as an instruction:

* Say what the value is and where it usually appears: *Payment deadline for the invoice.*
* Say the format you want back: *Use YYYY-MM-DD format.*, *Use ISO 4217 3-letter alpha code.*
* Say how to resolve ambiguity: *Date of the service. If specified as interval return the end of it.*
* For multi-value fields, say that several values are possible: *Purchasing orders listed on invoice.*

The [templates](https://typless.gitbook.io/typlessapi/typless-hub/document-type.md#method) come with tested descriptions for every field, and choosing a preset fills in its description. You can change the description of any field later, also of existing fields, see [Extending and Editing](https://typless.gitbook.io/typlessapi/typless/document-type/extending-and-editing.md).

<figure><img src="https://2174127710-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FePXqOCeLb4FOuZhmYG8X%2Fuploads%2Fgit-blob-5f64ebad9656229136075fe8b1a9adcf14b6b6c4%2Fdocument-type-01-field-editor.png?alt=media" alt=""><figcaption><p>Field editor of a pretrained document type with description and preset</p></figcaption></figure>

## Description for line item fields

If a pretrained document type extracts [line items](https://typless.gitbook.io/typlessapi/typless/line-items-table-extraction.md), it also needs a ***Description for line item fields***: which table or rows of the document are the line items, for example *Products and services listed in the invoice table.* Without it, the document type can't be created or saved. The input is above the ***Line item fields*** in both the create and the edit form.

## Supplier description

A supplier description holds instructions for the documents of one [supplier](https://typless.gitbook.io/typlessapi/typless/suppliers.md). Typless adds it to the extraction whenever it recognises a document from that supplier, so you can fix a supplier's quirks without changing the document type for everybody:

* *This supplier writes dates as MM/DD/YYYY.*
* *The invoice number is the number after "Račun št.", not the order number.*
* *Ignore the second page, it repeats the first page in German.*

A supplier exists once you have confirmed at least one of its documents, see [Suppliers](https://typless.gitbook.io/typlessapi/typless/suppliers.md).

## Presets

A preset marks a field as a well-known kind of value. When you choose a preset in the field editor, Typless fills in the field name, data type, the ***Multiple*** switch and, for pretrained document types, the description. For existing fields only the description is replaced; the name and data type stay as they are.

For pretrained document types, presets do more:

* **Location**: Typless looks for the value in the document text, so the result can include the value's position on the page and other candidate values.
* **Clean-up and validation**: values are returned in a standard form. For example, VAT IDs get their country prefix and lose extra characters (`HU23996898-2-10` becomes `HU23996898`), currency symbols become ISO 4217 codes and missing net or VAT amounts are calculated from the other amounts.
* **VAT rates**: [VAT rate extraction](https://typless.gitbook.io/typlessapi/typless/plugins/vat-rate-plugin.md) needs fields with the ***Net Amount*** and ***Total Amount*** presets.

Give every field that matches a preset that preset. A field without a preset is still extracted, only without these extra steps.

<details>

<summary>Metadata field presets</summary>

| Preset                  | Field name                | Data type |
| ----------------------- | ------------------------- | --------- |
| Supplier Name           | `supplier_name`           | Supplier  |
| Supplier Email          | `supplier_email`          | String    |
| Supplier VAT ID         | `supplier_vat_id`         | String    |
| Buyer Name              | `buyer_name`              | String    |
| Buyer Email             | `buyer_email`             | String    |
| Buyer VAT ID            | `buyer_vat_id`            | String    |
| Invoice Number          | `invoice_number`          | String    |
| Invoice Date            | `invoice_date`            | Date      |
| Payment Due Date        | `payment_due_date`        | Date      |
| Service Date            | `service_date`            | Date      |
| Received at Date        | `received_at_date`        | Date      |
| Total Amount            | `total_amount`            | Number    |
| Net Amount              | `net_amount`              | Number    |
| Vat Amount              | `vat_amount`              | Number    |
| Discount Percentage     | `discount_percentage`     | Number    |
| Currency                | `currency`                | Currency  |
| Payment Reference       | `payment_reference`       | String    |
| IBAN                    | `IBAN`                    | String    |
| Payment Purpose Code    | `payment_purpose_code`    | String    |
| Purchasing Order        | `purchasing_order`        | String    |
| Delivery Note           | `delivery_note`           | String    |
| Document Number         | `document_number`         | String    |
| Document Date           | `document_date`           | Date      |
| Street Name             | `address_street_name`     | String    |
| Street Number           | `address_street_number`   | String    |
| City                    | `address_city`            | String    |
| Postal Code             | `address_postal_code`     | String    |
| Country                 | `address_country`         | String    |
| Receipt Type            | `receipt_type`            | String    |
| Delivery Number         | `delivery_number`         | String    |
| Packing List Number     | `packing_list_number`     | String    |
| Account Number          | `account_number`          | String    |
| Start Balance           | `start_balance`           | Number    |
| End Balance             | `end_balance`             | Number    |
| Contract Party 1        | `contract_party_1`        | String    |
| Contract Party 1 Signee | `contract_party_1_signee` | String    |
| Contract Party 2 Signee | `contract_party_2_signee` | String    |
| Contract Summary        | `contract_summary`        | String    |
| Transporter Name        | `transporter_name`        | String    |
| Transporter VAT ID      | `transporter_vat_id`      | String    |

</details>

<details>

<summary>Line item field presets</summary>

| Preset                    | Field name                  | Data type |
| ------------------------- | --------------------------- | --------- |
| Item Description          | `item_description`          | String    |
| Item Code                 | `item_code`                 | String    |
| Item Series               | `item_series`               | String    |
| Buyer Identification Code | `buyer_identification_code` | String    |
| Quantity                  | `quantity`                  | Number    |
| Unit                      | `unit`                      | String    |
| Unit Net                  | `unit_net`                  | Number    |
| Unit Vat                  | `unit_vat`                  | Number    |
| Unit Total                | `unit_total`                | Number    |
| Net Amount                | `net_amount`                | Number    |
| Vat Amount                | `vat_amount`                | Number    |
| Total Amount              | `total_amount`              | Number    |
| Discount                  | `discount`                  | Number    |
| Discount Net Amount       | `discount_net_amount`       | Number    |
| Discount Percentage       | `discount_percentage`       | Number    |
| Vat Rate                  | `vat_rate`                  | Number    |
| Order Document Number     | `order_document_number`     | String    |
| Transaction Date          | `transaction_date`          | Date      |
| Transaction Type          | `transaction_type`          | String    |

</details>

## Extra fields for a single request

For a one-off need, you don't have to change the document type: `extract-data-async` accepts `additional_extraction_fields`, a list of extra fields with `name`, `type` and `description` that are extracted for that document only. See [Asynchronous extraction](https://typless.gitbook.io/typlessapi/typless/data-extraction/asynchronous-extraction.md).

## Tips for good descriptions

* Write for someone who has never seen your documents: name the label the value usually has and where it is.
* Describe the value, not the layout of one supplier. Put supplier-specific rules into the supplier description.
* Keep the format instructions that templates use (`Use YYYY-MM-DD format.`, `Use float format with dot separator.`) when you edit a description.
* After changing a description, extract a document again and compare the result in the [history](https://typless.gitbook.io/typlessapi/typless-hub/document-type.md#history).
