{% set u = m.usage or {} %}

{{ 'Frage' if m.role == 'user' else 'Antwort' }} {{ m.created.strftime('%H:%M') }} {% if m.role == 'assistant' and m.model %}{{ m.model }}{% endif %} {% if m.role == 'assistant' and u.get('context_tokens') and u.get('context_window') %}{% set pct = (100 * u.context_tokens / u.context_window)|round|int %}Kontext {{ pct }} %{% endif %} {% if m.role == 'assistant' and u.get('rules') %}Regeln: {{ u.rules|join(', ') }}{% endif %} {% if m.role == 'assistant' and u.get('hugin') %}Hugin: {% for k, v in u.hugin.items() %}{{ k }} {{ v }}{{ ', ' if not loop.last }}{% endfor %}{% endif %} {% if m.role == 'user' and u.get('command') %}Befehl {{ u.command.id }} {{ u.command.version }}{% endif %}

{% set calls = m.items|selectattr('type', 'equalto', 'function_call')|list if m.items else [] %} {% if calls %}
{{ calls|length }} Tool-Aufruf{{ 'e' if calls|length != 1 }}
    {% for c in calls %}
  1. {{ c.name }} {{ c.arguments }}
  2. {% endfor %}
{% endif %} {% if m.role == 'assistant' %}
{{ m.content|markdown }}
{% for call in (results|default({})).get(m.run_id, []) %} {% set r = call.result %} {% set figure = chart(r.columns, r.rows) %}
Abfrageergebnis: {{ r.rows|length }} Zeile{{ 'n' if r.rows|length != 1 }}{% if r.truncated %} (gekürzt){% endif %}, {{ r.columns|length }} Spalte{{ 'n' if r.columns|length != 1 }}{% if figure %} · mit Diagramm{% endif %}
{% if call.arguments.get('sql') %}
{{ call.arguments.sql }}
{% endif %} {% if figure %}{{ figure }}{% endif %}
{% for c in r.columns %}{% endfor %}{% for row in r.rows %}{% for v in row %}{% endfor %}{% endfor %}
{{ c }}
{{ '–' if v is none else v }}

Als CSV herunterladen {% if r.truncated %}Nur die ersten {{ r.rows|length }} Zeilen; für vollständige Auswertungen die KI aggregieren lassen.{% endif %}

{% endfor %} {% if (m.usage or {}).get('round_limit') %}

Das Limit an Tool-Schritten für eine Antwort ist erreicht; die KI hat den Stand zusammengefasst.

{% if latest %}
{% endif %}
{% endif %}
{% with message_id = m.id, fb = (feedback|default({})).get(m.id), thanks = false %}{% include "_feedback.html" %}{% endwith %}
{% else %}
{{ m.content }}
{% if (m.usage or {}).get('command') and m.items %}
An die KI gesendet
{{ m.items[0].content }}
{% endif %} {% endif %}