Save agent outputs to your custom templates
docx
or xlsx
template file for formatting and structure.
{{ prompt_name }}
. Note that placeholders must be lowercased, with spaces and special characters replaced with an underscore character (_
).
Kolena will preserve the font and format of the placeholders.
For example, if your placeholder is {{ company_name }}
in bolded, size 24, Times New Roman and your Agent Run has Company Name
extracted as Kolena Inc
, the placeholder will be replaced with Kolena Inc, also in bolded, size 24, Times New Roman.
All values in the template files that are not in placeholders (such as text, images, and borders) will be preserved as is.
placeholder
whenever you click into the details for the prompts.
placeholder
by editing the prompt. This allows you to map a prompt’s value to one that might not necessarily match the name exactly.
docx
template files, the templated report may be downloaded as either an editable docx
file, or a generated pdf
report. For xlsx
template files, the templated report can be downloaded as an editable xlsx
file.
{{ payments }}
prompt gave me a table with details on individual payments, the above syntax would allow me to replicate that table (with formatting) into my templated output. Note that the field being retrieved from the item
must match the prompt’s table columns but the header columns used in the template are free to differ.
person_info
with the fields ["Name", "Age", "Email", "Phone"]
, the unused fields are ignored.
if
syntax:
{{ tax_value }}
prompt retrieves a number greater than zero, and will otherwise not be displayed in the templated output.
{{ _kolena_date }}
: Date of the agent run in UTC, formatted as YYYY-MM-DD
.{{ _kolena_agent }}
: Name of the agent running the prompt.{{ sheet_name }}
{{ tpl_name }}
WARNING: This feature is experimental at the moment.Numbers in the generated XLSX files may sometimes show as text cells in Excel which break formulas. To fix this, instead of
{{ prompt_name }}
you can use {%xv prompt_name %}
in your xlsx
template file, such as {%xv item["Amount"] %}
, to specify an Excel value cell.