feat: 增强知识库索引与设置页面模块化拆分
扩展知识库索引任务和 RAG 检索支持增量入库和文档去重,优 化本体检测和规则匹配精度,前端设置页面拆分为 LLM、邮件 和 Hermes 员工同步子面板并重构样式,新增日志详情组件和 知识入库日志模型,补充单元测试覆盖。
This commit is contained in:
@@ -389,10 +389,10 @@ def test_semantic_ontology_service_prefers_expense_for_customer_entertainment_na
|
||||
assert result.clarification_required is True
|
||||
assert "customer_name" in result.missing_slots
|
||||
assert "participants" in result.missing_slots
|
||||
assert any(
|
||||
item.type == "expense_type" and item.normalized_value == "entertainment"
|
||||
for item in result.entities
|
||||
)
|
||||
assert any(
|
||||
item.type == "expense_type" and item.normalized_value == "meal"
|
||||
for item in result.entities
|
||||
)
|
||||
|
||||
|
||||
def test_semantic_ontology_service_uses_client_local_date_for_relative_time() -> None:
|
||||
@@ -556,6 +556,39 @@ def test_semantic_ontology_service_maps_taxi_ticket_reimbursement_to_transport_d
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"query,expected_type",
|
||||
[
|
||||
("报销飞机票和行程单", "travel"),
|
||||
("报销酒店发票和房费", "hotel"),
|
||||
("报销滴滴打车票", "transport"),
|
||||
("报销工作餐餐费", "meal"),
|
||||
("报销会议场地费", "meeting"),
|
||||
("报销客户接待餐", "meal"),
|
||||
("报销打印纸和硒鼓", "office"),
|
||||
("报销培训课程费", "training"),
|
||||
("报销手机话费和流量费", "communication"),
|
||||
("报销员工体检费", "welfare"),
|
||||
],
|
||||
)
|
||||
def test_semantic_ontology_service_covers_common_expense_scene_keywords(
|
||||
query: str,
|
||||
expected_type: str,
|
||||
) -> None:
|
||||
session_factory = build_session_factory()
|
||||
with session_factory() as db:
|
||||
result = SemanticOntologyService(db).parse(
|
||||
OntologyParseRequest(query=query, user_id="pytest")
|
||||
)
|
||||
|
||||
assert result.scenario == "expense"
|
||||
assert result.intent == "draft"
|
||||
assert any(
|
||||
item.type == "expense_type" and item.normalized_value == expected_type
|
||||
for item in result.entities
|
||||
)
|
||||
|
||||
|
||||
def test_semantic_ontology_service_uses_model_parse_when_available(monkeypatch) -> None:
|
||||
session_factory = build_session_factory()
|
||||
with session_factory() as db:
|
||||
|
||||
Reference in New Issue
Block a user