{% extends "base.html" %} {% block title %}Agent - {{ conversation.title or "Chat" }}{% endblock %} {% block extra_head %} {% endblock %} {% block content %}
← Back

{{ conversation.title or "Chat" }}

{% set in_tool_group = namespace(value=false) %} {% for msg in messages %} {% if msg.role in ("tool_call", "tool_result") %} {% if not in_tool_group.value %}
{% set in_tool_group.value = true %} {% endif %} {% if msg.role == "tool_call" %}
Tool: {{ msg.tool_name }}
{{ msg.tool_arguments }}
{% elif msg.role == "tool_result" %} {% set html_content = msg.tool_output | agent_extract_html %} {% if html_content %}
{% set in_tool_group.value = false %}
{{ html_content | safe }}
{% set in_tool_group.value = true %} {% endif %}
Result: {{ msg.tool_name }}
{{ msg.tool_output | agent_pretty_json }}
{% endif %} {% else %} {% if in_tool_group.value %}
{% set in_tool_group.value = false %} {% endif %} {% if msg.role == "user" %}
{{ msg.content }}
{% elif msg.role == "assistant" %}
{{ msg.content }}
{% elif msg.role == "reasoning" and msg.content %}
Thinking
{{ msg.content }}
{% endif %} {% endif %} {% endfor %} {% if in_tool_group.value %}
{% endif %}
{% if not background_agent %}
{% endif %} {% if not background_agent %} {% else %} {% endif %} {% endblock %}