{% extends "base.html" %} {% block title %}{{ scenario.name|default:"Agent 对话" }}{% endblock %} {% block content %} {% if error %}
{{ error }}
{% endif %} {% if scenario %}

提问面板

可以直接提问,也可以勾选部分已入库文档作为当前上下文范围。

{% csrf_token %}
{{ form.message.label_tag }} {{ form.message }} {% if form.message.errors %}

{{ form.message.errors|join:" " }}

{% endif %}
{{ form.document_ids.label_tag }}

不勾选时默认检索当前场景全部已入库文档。

{% for checkbox in form.document_ids %} {% empty %}
当前场景还没有已入库文档,系统将仅依赖工具和模型能力生成结果。
{% endfor %}
{% if form.document_ids.errors %}

{{ form.document_ids.errors|join:" " }}

{% endif %}

执行说明

  • 1. 场景配置 系统会先读取当前 YAML 场景配置,确定角色、目标、工具和输出结构。
  • 2. RAG 与工具 如果场景启用了知识库检索,系统会根据你的问题召回相关片段,并执行声明式工具。
  • 3. 结构化结果 Agent Core 会优先解析 JSON 输出,解析失败时回退为稳定的展示结构。

回答总览

{% if result %}
  • 模型:{{ result.model_name }}
  • 状态:{{ result.status }}
  • 耗时:{{ result.latency_ms }} ms
主回答
{{ result.answer|linebreaksbr }}
{% if audit_log %}

查看本次审计日志

{% endif %} {% else %}
提交问题后,这里会展示 Agent 的主回答、模型信息和执行状态。
{% endif %}
{% if result %}

结构化结果

{% for key, value in result.structured_output.items %} {% endfor %}
{{ key }} {% if key == "answer" or key == "summary" or key == "reply" %} {{ value|linebreaksbr }} {% else %}
{{ value }}
{% endif %}

引用片段

{% if result.references %}
    {% for reference in result.references %}
  • {{ reference.source }}
    {{ reference.content|default:"无正文内容"|linebreaksbr }}
  • {% endfor %}
{% else %}
当前回答没有引用知识库片段。
{% endif %}

工具调用

{% if result.tool_calls %}
    {% for tool_call in result.tool_calls %}
  • {{ tool_call.tool_name }}

    执行状态:{{ tool_call.success }}

    {% if tool_call.error %}

    {{ tool_call.error }}

    {% endif %}
    {{ tool_call.result }}
  • {% endfor %}
{% else %}
当前场景没有声明工具,或本次执行无需调用工具。
{% endif %}
{% if result.error %}

错误信息

{{ result.error }}
{% endif %} {% endif %}
{% endif %} {% endblock %}