{# partials/_input.html Renders the input prompt section of a result entry. Expects: entry, truncated (bool), process_text(), process_standardised_conversation(), text_to_colour() #} {% if entry.system_message and entry.system_message is not none and entry.system_message != '' %}
System Message
{{ process_text(entry.system_message, truncated=truncated)|e }}
{% endif %} {% set _has_trace = entry.conversation or (entry.input is mapping) or (entry.input is sequence and entry.input is not string) %} {% set _collapse_id = "trace-" ~ (entry.id | string | replace("-","_")) %}
{% if entry.conversation %} Attack Conversation Trace {% elif entry.input is mapping or (entry.input is sequence and entry.input is not string) %} Multi-Turn Input {% else %} Input Prompt {% endif %}
{% if _has_trace %} {% endif %}
{% if entry.objective and not entry.conversation and entry.objective is not none and entry.objective != '' %}
Objective:{{ entry.objective|e }}
{% endif %} {# ── Standardised attack conversation trace ── #} {% if entry.conversation %}
{{ process_standardised_conversation(entry.conversation, truncated=truncated) | safe }}
{# ── Multi-turn mapping: {conversation: [{role, content}, ...]} ── #} {% elif entry.input is mapping %}
{% for message in entry.input.conversation %}
{{ message.role | upper }}
{{ process_text(message.content, truncated=truncated)|e }}
{% endfor %}
{# ── Sequence of messages ── #} {% elif entry.input is sequence and entry.input is not string %}
{% for message in entry.input %}
{{ process_text(message, truncated=truncated)|e }}
{% endfor %}
{# ── Plain string ── #} {% else %}
{{ process_text(entry.input, truncated=truncated)|e }}
{% endif %}