chore(master): 清理V2合并后的旧版遗留文件

This commit is contained in:
2026-06-11 00:09:54 +08:00
parent 64d09ec30f
commit ccd6e8ef4d
89 changed files with 0 additions and 7318 deletions

View File

@@ -1,61 +0,0 @@
{% extends "base.html" %}
{% block title %}审计日志详情{% endblock %}
{% block content %}
<header class="page-header">
<span class="eyebrow">日志详情</span>
<h1 class="page-title">审计日志 #{{ log.id }}</h1>
<p class="page-lead">这里集中展示当前请求的输入、模型输出、知识库引用和工具调用记录。</p>
<p style="margin-top: 14px;"><a class="button" href="{% url 'audit:list' %}">返回审计列表</a></p>
</header>
<section class="stack">
<article class="panel">
<h2 class="section-title">基础信息</h2>
<ul class="meta-list">
<li class="meta-badge">场景:{{ log.scenario_name }}</li>
<li class="meta-badge">状态:{{ log.get_status_display_text }}</li>
<li class="meta-badge">模型:{{ log.model_name }}</li>
<li class="meta-badge">耗时:{{ log.latency_ms }} ms</li>
</ul>
</article>
<article class="panel">
<h2 class="section-title">用户输入</h2>
<div class="detail-item">{{ log.user_input|linebreaksbr }}</div>
</article>
<article class="panel">
<h2 class="section-title">最终回答</h2>
<div class="detail-item">{{ log.final_answer|linebreaksbr }}</div>
</article>
<article class="panel">
<h2 class="section-title">结构化输出</h2>
<pre class="code-block">{{ log.structured_output }}</pre>
</article>
<article class="panel">
<h2 class="section-title">引用来源</h2>
<pre class="code-block">{{ log.retrieved_chunks }}</pre>
</article>
<article class="panel">
<h2 class="section-title">工具调用</h2>
<pre class="code-block">{{ log.tool_calls }}</pre>
</article>
<article class="panel">
<h2 class="section-title">原始输出</h2>
<pre class="code-block">{{ log.raw_output }}</pre>
</article>
{% if log.error_message %}
<article class="panel">
<h2 class="section-title">错误信息</h2>
<pre class="code-block">{{ log.error_message }}</pre>
</article>
{% endif %}
</section>
{% endblock %}

View File

@@ -1,50 +0,0 @@
{% extends "base.html" %}
{% block title %}审计日志{% endblock %}
{% block content %}
<header class="page-header">
<span class="eyebrow">执行留痕</span>
<h1 class="page-title">审计日志</h1>
<p class="page-lead">每次 Agent 执行都会记录模型、检索片段、工具调用和最终结果,方便演示链路可解释性。</p>
{% if selected_scenario_id %}
<p style="margin-top: 14px;">
<span class="meta-badge">当前筛选场景:{{ selected_scenario_id }}</span>
<a class="button" href="{% url 'audit:list' %}">清空筛选</a>
</p>
{% endif %}
</header>
<article class="panel">
<table class="kv-table">
<thead>
<tr>
<th>ID</th>
<th>场景</th>
<th>输入摘要</th>
<th>状态</th>
<th>模型</th>
<th>耗时</th>
<th>创建时间</th>
<th>详情</th>
</tr>
</thead>
<tbody>
{% for log in logs %}
<tr>
<td>{{ log.id }}</td>
<td>{{ log.scenario_name }}</td>
<td>{{ log.get_user_input_summary }}</td>
<td>{{ log.get_status_display_text }}</td>
<td>{{ log.model_name }}</td>
<td>{{ log.latency_ms }} ms</td>
<td>{{ log.created_at|date:"Y-m-d H:i" }}</td>
<td><a class="button" href="{% url 'audit:detail' log.id %}">查看详情</a></td>
</tr>
{% empty %}
<tr><td colspan="8">暂无审计日志,先去执行一次对话吧。</td></tr>
{% endfor %}
</tbody>
</table>
</article>
{% endblock %}

View File

@@ -1,169 +0,0 @@
{% extends "base.html" %}
{% block title %}{{ scenario.name|default:"Agent 对话" }}{% endblock %}
{% block content %}
{% if error %}
<section class="notice notice-error">{{ error }}</section>
{% endif %}
{% if scenario %}
<header class="page-header">
<span class="eyebrow">Agent 对话</span>
<h1 class="page-title">{{ scenario.name }}</h1>
<p class="page-lead">{{ scenario.description }}</p>
<ul class="meta-list">
<li class="meta-badge">角色:{{ scenario.agent.role }}</li>
<li class="meta-badge">目标:{{ scenario.agent.goal }}</li>
<li class="meta-badge">已入库文档:{{ document_count }}</li>
<li class="meta-badge">输出类型:{{ scenario.output.type }}</li>
</ul>
</header>
<section class="layout-two-columns">
<div class="stack">
<article class="panel">
<h2 class="section-title">提问面板</h2>
<p class="muted">可以直接提问,也可以勾选部分已入库文档作为当前上下文范围。</p>
<form method="post" class="stack">
{% csrf_token %}
<div>
{{ form.message.label_tag }}
{{ form.message }}
{% if form.message.errors %}
<p class="notice notice-error">{{ form.message.errors|join:" " }}</p>
{% endif %}
</div>
<div>
{{ form.document_ids.label_tag }}
<p class="help-text">不勾选时默认检索当前场景全部已入库文档。</p>
<div class="checkbox-list">
{% for checkbox in form.document_ids %}
<label class="checkbox-item">
{{ checkbox.tag }}
<span>{{ checkbox.choice_label }}</span>
</label>
{% empty %}
<div class="notice">当前场景还没有已入库文档,系统将仅依赖工具和模型能力生成结果。</div>
{% endfor %}
</div>
{% if form.document_ids.errors %}
<p class="notice notice-error">{{ form.document_ids.errors|join:" " }}</p>
{% endif %}
</div>
<div>
<button type="submit">提交问题并执行 Agent</button>
</div>
</form>
</article>
<article class="panel">
<h2 class="section-title">执行说明</h2>
<ul class="detail-list">
<li class="detail-item">
<strong>1. 场景配置</strong>
系统会先读取当前 YAML 场景配置,确定角色、目标、工具和输出结构。
</li>
<li class="detail-item">
<strong>2. RAG 与工具</strong>
如果场景启用了知识库检索,系统会根据你的问题召回相关片段,并执行声明式工具。
</li>
<li class="detail-item">
<strong>3. 结构化结果</strong>
Agent Core 会优先解析 JSON 输出,解析失败时回退为稳定的展示结构。
</li>
</ul>
</article>
</div>
<div class="stack">
<article class="panel">
<h2 class="section-title">回答总览</h2>
{% if result %}
<ul class="meta-list">
<li class="meta-badge">模型:{{ result.model_name }}</li>
<li class="meta-badge {% if result.status == 'success' %}status-success{% else %}status-failed{% endif %}">状态:{{ result.status }}</li>
<li class="meta-badge">耗时:{{ result.latency_ms }} ms</li>
</ul>
<div class="detail-item" style="margin-top: 16px;">
<strong>主回答</strong>
<div>{{ result.answer|linebreaksbr }}</div>
</div>
{% if audit_log %}
<p style="margin-top: 14px;">
<a class="button" href="{% url 'audit:detail' audit_log.id %}">查看本次审计日志</a>
</p>
{% endif %}
{% else %}
<div class="notice">提交问题后,这里会展示 Agent 的主回答、模型信息和执行状态。</div>
{% endif %}
</article>
{% if result %}
<article class="panel">
<h2 class="section-title">结构化结果</h2>
<table class="kv-table">
<tbody>
{% for key, value in result.structured_output.items %}
<tr>
<th>{{ key }}</th>
<td>
{% if key == "answer" or key == "summary" or key == "reply" %}
{{ value|linebreaksbr }}
{% else %}
<pre class="code-block">{{ value }}</pre>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</article>
<article class="panel">
<h2 class="section-title">引用片段</h2>
{% if result.references %}
<ul class="detail-list">
{% for reference in result.references %}
<li class="detail-item">
<strong>{{ reference.source }}</strong>
<div>{{ reference.content|default:"无正文内容"|linebreaksbr }}</div>
</li>
{% endfor %}
</ul>
{% else %}
<div class="notice">当前回答没有引用知识库片段。</div>
{% endif %}
</article>
<article class="panel">
<h2 class="section-title">工具调用</h2>
{% if result.tool_calls %}
<ul class="detail-list">
{% for tool_call in result.tool_calls %}
<li class="detail-item">
<strong>{{ tool_call.tool_name }}</strong>
<p class="muted">执行状态:{{ tool_call.success }}</p>
{% if tool_call.error %}
<p class="notice notice-error">{{ tool_call.error }}</p>
{% endif %}
<pre class="code-block">{{ tool_call.result }}</pre>
</li>
{% endfor %}
</ul>
{% else %}
<div class="notice">当前场景没有声明工具,或本次执行无需调用工具。</div>
{% endif %}
</article>
{% if result.error %}
<article class="panel">
<h2 class="section-title">错误信息</h2>
<pre class="code-block">{{ result.error }}</pre>
</article>
{% endif %}
{% endif %}
</div>
</section>
{% endif %}
{% endblock %}

View File

@@ -1,54 +0,0 @@
{% extends "base.html" %}
{% block title %}文档中心{% endblock %}
{% block content %}
<header class="page-header">
<span class="eyebrow">知识库资料</span>
<h1 class="page-title">文档中心</h1>
<p class="page-lead">上传题目材料后,可以在这里管理文件状态,并手动触发入库。</p>
<p style="margin-top: 14px;"><a class="button button-primary" href="{% url 'documents:upload' %}">上传新文件</a></p>
</header>
<article class="panel">
<table class="kv-table">
<thead>
<tr>
<th>文件名</th>
<th>场景</th>
<th>类型</th>
<th>大小</th>
<th>状态</th>
<th>操作</th>
</tr>
</thead>
<tbody>
{% for document in documents %}
<tr>
<td>{{ document.original_name }}</td>
<td>{{ document.scenario_id }}</td>
<td>{{ document.file_type }}</td>
<td>{{ document.size }}</td>
<td>{{ document.get_status_display_text }}</td>
<td>
{% if document.status != "indexed" %}
<form action="{% url 'documents:index' document.id %}" method="post">
{% csrf_token %}
<button type="submit">执行入库</button>
</form>
{% else %}
<span class="status status-success">已可用于检索</span>
{% endif %}
{% if document.error_message %}
<pre class="code-block" style="margin-top: 10px;">{{ document.error_message }}</pre>
{% endif %}
<p class="muted" style="margin-top: 10px;">上传时间:{{ document.created_at|date:"Y-m-d H:i" }}</p>
</td>
</tr>
{% empty %}
<tr><td colspan="6">暂无文件,请先上传题目材料。</td></tr>
{% endfor %}
</tbody>
</table>
</article>
{% endblock %}

View File

@@ -1,38 +0,0 @@
{% extends "base.html" %}
{% block title %}上传文件{% endblock %}
{% block content %}
<header class="page-header">
<span class="eyebrow">文件上传</span>
<h1 class="page-title">上传题目材料或知识库文档</h1>
<p class="page-lead">支持 `.txt`、`.md`、`.pdf` 和 `.docx`。上传后可以在文档中心手动执行入库。</p>
</header>
<article class="panel" style="max-width: 760px;">
<form method="post" enctype="multipart/form-data" class="stack">
{% csrf_token %}
<div>
{{ form.scenario_id.label_tag }}
{{ form.scenario_id }}
{% if form.scenario_id.errors %}
<p class="notice notice-error">{{ form.scenario_id.errors|join:" " }}</p>
{% endif %}
</div>
<div>
{{ form.file.label_tag }}
{{ form.file }}
{% if form.file.errors %}
<p class="notice notice-error">{{ form.file.errors|join:" " }}</p>
{% endif %}
</div>
{% if form.errors %}
<div class="notice notice-error">{{ form.errors }}</div>
{% endif %}
<div style="display: flex; gap: 10px; flex-wrap: wrap;">
<button type="submit">上传文件</button>
<a class="button" href="{% url 'documents:list' %}">返回文件列表</a>
</div>
</form>
</article>
{% endblock %}

View File

@@ -1,53 +0,0 @@
{% extends "base.html" %}
{% block title %}场景首页{% endblock %}
{% block content %}
<header class="page-header">
<span class="eyebrow">场景总览</span>
<h1 class="page-title">用同一套底座快速切换不同业务 Agent</h1>
<p class="page-lead">当前首页直接读取 YAML 场景配置。你可以从这里进入对话、上传资料,再用审计日志验证整条执行链路。</p>
</header>
{% if scenario_issues %}
<section class="panel" style="margin-bottom: 20px;">
<h2 class="section-title">配置异常</h2>
<p class="muted">以下 YAML 场景文件存在问题,系统已自动跳过,不会影响其它合法场景展示。</p>
<ul class="detail-list">
{% for issue in scenario_issues %}
<li class="detail-item">
<strong>{{ issue.file_name }}</strong>
<div>{{ issue.message }}</div>
</li>
{% endfor %}
</ul>
</section>
{% endif %}
<section class="card-grid">
{% for scenario in scenarios %}
<article class="card">
<h2>{{ scenario.name }}</h2>
<p>{{ scenario.description }}</p>
<ul class="meta-list">
<li class="meta-badge">场景 ID{{ scenario.id }}</li>
<li class="meta-badge">输出:{{ scenario.output.type }}</li>
<li class="meta-badge">RAG{% if scenario.rag.enabled %}已启用{% else %}未启用{% endif %}</li>
<li class="meta-badge">工具数:{{ scenario.tool_count }}</li>
</ul>
<p class="muted" style="margin-top: 14px;">适用题型:
{% if scenario.applicable_questions %}
{{ scenario.applicable_questions|join:"、" }}
{% else %}
暂未配置
{% endif %}
</p>
<p style="margin-top: 16px;">
<a class="button button-primary" href="{% url 'chat:index' scenario.id %}">进入对话</a>
</p>
</article>
{% empty %}
<div class="notice">暂无可用场景,请检查 `configs/` 目录和 YAML 配置内容。</div>
{% endfor %}
</section>
{% endblock %}