{# 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 %}
Guardrail Triggered
{{ entry.guardrail_categories|e if entry.guardrail_categories is not none else "—" }}
{% elif entry.response is sequence and entry.response is not string and entry.response is not mapping %}
{# List of messages — render as conversation thread #}
{% set _response_size = entry.response | length %}
{% set _response_expanded = not truncated or _response_size <= 8 %}
Response conversation · {{ _response_size }} messages
{% for message in entry.response %}
{% if message is mapping %}