feat(audit): 补充原始模型输出展示
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
<h2 class="section-title">基础信息</h2>
|
||||
<ul class="meta-list">
|
||||
<li class="meta-badge">场景:{{ log.scenario_name }}</li>
|
||||
<li class="meta-badge">状态:{{ log.status }}</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>
|
||||
@@ -46,6 +46,11 @@
|
||||
<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>
|
||||
|
||||
@@ -62,6 +62,23 @@ def test_audit_list_page_shows_user_input_summary(client, db):
|
||||
assert "这是一个比较长的用户输入" in response.content.decode("utf-8")
|
||||
|
||||
|
||||
def test_audit_detail_page_shows_raw_output(client, db):
|
||||
result = AgentResult(
|
||||
answer="结构化回答",
|
||||
raw_output='{"answer":"结构化回答","confidence":"high"}',
|
||||
status="success",
|
||||
)
|
||||
log = create_audit_log("knowledge_qa", "知识库问答助手", "问题", result)
|
||||
|
||||
response = client.get(reverse("audit:detail", args=[log.id]))
|
||||
|
||||
content = response.content.decode("utf-8")
|
||||
assert response.status_code == 200
|
||||
assert "原始输出" in content
|
||||
assert "confidence" in content
|
||||
assert "high" in content
|
||||
|
||||
|
||||
def test_create_audit_log_masks_api_keys_from_error_message(db):
|
||||
result = AgentResult(
|
||||
answer="",
|
||||
|
||||
Reference in New Issue
Block a user