Field Types

Every field in an AdviceDocs template has a type. The type drives how data is extracted, validated, and rendered into the final document. Most types are inferred automatically when you upload a template; the rest can be set or overridden in the field configuration UI.

How types are decided

AdviceDocs picks a type for each field via three layers:

  1. Manual override — if you set the type in the UI, it sticks. The flag is_field_type_manual = true protects it from being changed by re-parsing.
  2. Auto-inference at parse time — based on substrings in the field name (see the table below).
  3. LLM classification (post-parse) — for the rich content types (recommendation, benefits, things to consider, alternatives, content), a separate classification step reads the field’s description and chooses the best fit.

Auto-inferred types (from the field name)

At parse time, the first matching rule wins. Order matters — image is checked before graph, so a field named graph_image becomes an image, not a graph.

  • image — if the name contains image. Example: {{ profile_image }}.
  • graph — if the name contains graph. Example: {{ portfolio_graph }}.
  • date — if the name is exactly dob, exactly date, or contains date. Example: {{ date_of_birth }}.
  • currency — if the last underscore-separated segment is one of value, balance, amount, price, total, dollars. Example: {{ account_balance }}.
  • number — if the name contains number. Example: {{ account_number }}.
  • text — the default for everything else.

LLM-classified rich content types

The five rich content types are not detected by name. After parsing, an LLM reads each field’s description (the one-line note you write in the editor) and picks whichever of these best matches:

  • recommendation — long-form advice content, e.g. “detail the recommendations from the advice summary”.
  • benefits — positive outcomes of the recommended advice.
  • things_to_consider — risks, trade-offs, caveats.
  • alternatives — strategies considered but not recommended.
  • content — open-ended rich content that doesn’t fit the four above.

Each rich content type has its own dedicated docs page with the syntax, configuration, and pitfalls.

Other types you can set manually

  • object — a parent field that has children (used for nested data like client.address.city).
  • modelling — a multi-year financial projection table.
  • risk_profile — a structured risk-profile asset-allocation table.
  • select — a value picked from a fixed list of options.
  • workflow, error, PDS — system types used by internal pipelines; you generally won’t set these directly.

What each type exposes in the configuration UI

  • text / number / currency / date — description and example value only; no extra config.
  • image — width, height, “use natural size” reset.
  • graph — chart type, base colour, dimensions, font.
  • modelling — projection years, row structure, value colours, number display.
  • risk_profile — table orientation, header / asset visibility, table colours.
  • recommendation / benefits / things_to_consider / alternatives / content — configured at the template level via the gear icon next to the template name. Each type slot lets you point at an example document for tone and structure.

Manual override sticks

Once you change a field’s type in the UI, AdviceDocs records is_field_type_manual = true on that field. Subsequent re-parses won’t overwrite your choice. To resume auto-inference, reset the flag from the field menu.

Common pitfalls

Order of precedence: image before graph

A field named graph_image becomes image, not graph, because the inference rules check “image” first. If you want a graph, drop the word “image” from the name — or set the type manually.

Currency only matches the LAST segment

{{ recommended_amount }} becomes currency (last segment is amount). {{ amount_recommended }} does NOT — the last segment is recommended, which isn’t in the currency list.

Rich content needs a description

The LLM classifier reads the field description, not the name. A field named recommendation with no description will probably stay as text. Always add a clear description for rich content fields.

Syntax to copy

Auto-inferred from the name
{{ client_name }}            <!-- text -->
{{ account_number }}         <!-- number -->
{{ account_balance }}        <!-- currency -->
{{ date_of_birth }}          <!-- date -->
{{ profile_image }}          <!-- image -->
{{ portfolio_graph }}        <!-- graph -->
Rich content (set manually or via LLM)
{{ recommendation }}
{{ benefits }}
{{ things_to_consider }}
{{ alternatives }}
{{ content }}