{% load i18n djpa %} {% comment %} One line of the transcript. The context: kind (user, assistant, tool_call, tool_result or error), text, tool_name and files. A tool line is a closed details element: the summary shows the words, and the user opens it to see the data. The files of a user line come before its text. Each file shows its name. A file with a URL is a link that opens in a new tab. {% endcomment %} {% if kind == "user" %} {% if files %} {% endif %}
{{ text|linebreaksbr }}
{% elif kind == "assistant" %}
{{ text|djpa_reply_html }}
{% elif kind == "tool_call" %}
{% include "dj_pydantic_agents/tool_label.html" with tool_name=tool_name state="called" only %}
{{ text }}
{% elif kind == "tool_result" %}
{% include "dj_pydantic_agents/tool_label.html" with tool_name=tool_name state="result" only %}
{{ text }}
{% elif kind == "error" %}
{{ text }}
{% endif %}