feat: 增强规则资产管理与审计页面运行时调试
后端新增规则资产版本管理和规则文件 CRUD 接口,优化风险 规则生成模板执行和员工数据模型字段,知识库 RAG 增强本 地回退和文档提取能力,清理旧风险规则文件统一由生成引擎 管理,前端审计页面增加运行时调试面板和规则资产编辑交互, 补充单元测试覆盖。
This commit is contained in:
@@ -58,6 +58,34 @@ def test_build_hits_boosts_query_term_matches() -> None:
|
||||
assert [item["candidate_id"] for item in hits] == ["ent-1", "travel-1"]
|
||||
|
||||
|
||||
def test_build_hits_keeps_long_query_anchor_terms_for_accounting_table() -> None:
|
||||
hits = KnowledgeRagService._build_hits_from_query_data(
|
||||
query="远光软件财务基础知识手册里的常用会计科目是什么?",
|
||||
chunks=[
|
||||
{
|
||||
"chunk_id": "generic-1",
|
||||
"file_path": "/tmp/doc-1__远光软件财务制度培训手册.docx",
|
||||
"content": "远光软件股份有限公司财务培训内容,介绍费用报销和财务制度。",
|
||||
},
|
||||
{
|
||||
"chunk_id": "accounts-1",
|
||||
"file_path": "/tmp/doc-2__远光软件财务基础知识手册.docx",
|
||||
"content": (
|
||||
"二、常用会计科目\n\n"
|
||||
"| 科目类别 | 科目名称 | 说明 |\n"
|
||||
"| --- | --- | --- |\n"
|
||||
"| 资产类 | 库存现金 | 公司持有的现金 |\n"
|
||||
"| 损益类 | 销售费用 | 为销售产品发生的费用 |"
|
||||
),
|
||||
},
|
||||
],
|
||||
entities=[],
|
||||
limit=2,
|
||||
)
|
||||
|
||||
assert [item["candidate_id"] for item in hits] == ["accounts-1", "generic-1"]
|
||||
|
||||
|
||||
def test_build_hits_prioritizes_answer_clue_appendix_for_rule_queries() -> None:
|
||||
hits = KnowledgeRagService._build_hits_from_query_data(
|
||||
query="报销时限是多少?",
|
||||
|
||||
Reference in New Issue
Block a user