{# partials/_response.html Renders the response / error / guardrail section of a result entry. Expects: entry, truncated (bool), process_text(), text_to_colour() #} {% if entry.guardrail %} {% elif entry.error and entry.error != "" %} {% elif entry.response is sequence and entry.response is not string %} {# List of messages — render as conversation thread #}
Response
{% for message in entry.response %} {% if message is mapping %}
{% for key, value in message.items() %}
{{ key | upper }}
{{ process_text(value, truncated=truncated)|e }}
{% endfor %}
{% else %}
{{ process_text(message, truncated=truncated)|e }}
{% endif %} {% endfor %}
{% elif entry.response is mapping %} {# Dict response — pretty-printed JSON #}
Response — structured JSON object
{% else %}
Response
{{ process_text(entry.response, truncated=truncated)|e }}
{% endif %}