feat: 增强审核智能体页完整性与字段抽取能力卡展示
This commit is contained in:
@@ -466,6 +466,86 @@ def test_chat_page_shows_consistency_card_from_conversation_summary(client, db):
|
||||
assert "high" in content
|
||||
|
||||
|
||||
def test_chat_page_shows_completeness_card_from_conversation_summary(client, db):
|
||||
batch, conversation = _create_conversation_with_batch()
|
||||
conversation.latest_summary = {
|
||||
"structured_output": {
|
||||
"output_type": "registration_completeness_report",
|
||||
"summary": "当前资料包仍缺少关键必交项。",
|
||||
"risk_level": "high",
|
||||
"missing_items": [
|
||||
{
|
||||
"chapter_code": "CH2",
|
||||
"document_name": "产品技术要求",
|
||||
"reason": "当前资料包未发现对应文件",
|
||||
}
|
||||
],
|
||||
"misplaced_items": [
|
||||
{
|
||||
"chapter_code": "CH4",
|
||||
"document_name": "研究资料",
|
||||
"current_location": "CH6",
|
||||
}
|
||||
],
|
||||
}
|
||||
}
|
||||
conversation.save(update_fields=["latest_summary", "updated_at"])
|
||||
|
||||
response = client.get(reverse("chat:detail", args=[conversation.conversation_id]))
|
||||
|
||||
content = response.content.decode("utf-8")
|
||||
assert response.status_code == 200
|
||||
assert "完整性检查能力卡" in content
|
||||
assert "当前资料包仍缺少关键必交项" in content
|
||||
assert "产品技术要求" in content
|
||||
assert "CH2" in content
|
||||
assert "当前资料包未发现对应文件" in content
|
||||
assert "研究资料" in content
|
||||
assert "当前归类:CH6" in content
|
||||
|
||||
|
||||
def test_chat_page_shows_field_extraction_card_from_conversation_summary(client, db):
|
||||
batch, conversation = _create_conversation_with_batch()
|
||||
conversation.latest_summary = {
|
||||
"structured_output": {
|
||||
"output_type": "registration_field_extraction_report",
|
||||
"summary": "已完成核心注册字段抽取。",
|
||||
"field_items": [
|
||||
{
|
||||
"field_name": "产品名称",
|
||||
"field_value": batch.product_name,
|
||||
"source_document": "申请表.docx",
|
||||
},
|
||||
{
|
||||
"field_name": "规格型号",
|
||||
"field_value": "48T/盒",
|
||||
"source_document": "产品列表.xlsx",
|
||||
},
|
||||
],
|
||||
"low_confidence_items": [
|
||||
{
|
||||
"field_name": "储存条件",
|
||||
"field_value": "2-8℃",
|
||||
"source_document": "说明书.docx",
|
||||
}
|
||||
],
|
||||
}
|
||||
}
|
||||
conversation.save(update_fields=["latest_summary", "updated_at"])
|
||||
|
||||
response = client.get(reverse("chat:detail", args=[conversation.conversation_id]))
|
||||
|
||||
content = response.content.decode("utf-8")
|
||||
assert response.status_code == 200
|
||||
assert "字段抽取能力卡" in content
|
||||
assert "已完成核心注册字段抽取" in content
|
||||
assert "产品名称" in content
|
||||
assert "48T/盒" in content
|
||||
assert "来源:申请表.docx" in content
|
||||
assert "储存条件" in content
|
||||
assert "来源:说明书.docx" in content
|
||||
|
||||
|
||||
def test_chat_page_blocks_formal_export_when_word_export_node_is_blocked(client, db):
|
||||
batch, conversation = _create_conversation_with_batch()
|
||||
conversation.node_results = [
|
||||
|
||||
Reference in New Issue
Block a user