feat(chat): 打通场景对话与结果展示
This commit is contained in:
61
templates/chat/index.html
Normal file
61
templates/chat/index.html
Normal file
@@ -0,0 +1,61 @@
|
||||
<!doctype html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Agent 对话</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Agent 对话</h1>
|
||||
<nav><a href="/">返回首页</a></nav>
|
||||
|
||||
{% if error %}
|
||||
<p>{{ error }}</p>
|
||||
{% endif %}
|
||||
|
||||
{% if scenario %}
|
||||
<section>
|
||||
<h2>{{ scenario.name }}</h2>
|
||||
<p>{{ scenario.description }}</p>
|
||||
<p>角色:{{ scenario.agent.role }}</p>
|
||||
<p>目标:{{ scenario.agent.goal }}</p>
|
||||
</section>
|
||||
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<button type="submit">提交</button>
|
||||
</form>
|
||||
|
||||
{% if result %}
|
||||
<section>
|
||||
<h2>回答</h2>
|
||||
<p>{{ result.answer }}</p>
|
||||
<p>模型:{{ result.model_name }}</p>
|
||||
<p>状态:{{ result.status }}</p>
|
||||
<p>耗时:{{ result.latency_ms }} ms</p>
|
||||
</section>
|
||||
<section>
|
||||
<h2>结构化输出</h2>
|
||||
<pre>{{ result.structured_output }}</pre>
|
||||
</section>
|
||||
<section>
|
||||
<h2>引用来源</h2>
|
||||
<pre>{{ result.references }}</pre>
|
||||
</section>
|
||||
<section>
|
||||
<h2>工具调用</h2>
|
||||
<pre>{{ result.tool_calls }}</pre>
|
||||
</section>
|
||||
{% if audit_log %}
|
||||
<p><a href="{% url 'audit:detail' audit_log.id %}">查看审计日志</a></p>
|
||||
{% endif %}
|
||||
{% if result.error %}
|
||||
<section>
|
||||
<h2>错误信息</h2>
|
||||
<pre>{{ result.error }}</pre>
|
||||
</section>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user