feat: 重构知识库系统,移除Hermes集成,增强RAG和同步功能
主要变更: - 移除Hermes智能体及相关回调服务 - 新增知识库RAG、同步、调度、规范化和索引任务服务 - 重构orchestrator服务,增强运行时聊天功能 - 更新前端聊天、政策制度、设置等页面样式和逻辑 - 更新expense_claims和document_intelligence服务 - 删除llm_wiki相关服务和测试文件 - 更新docker-compose配置和启动脚本
This commit is contained in:
@@ -310,6 +310,44 @@ def test_semantic_ontology_service_keeps_travel_amount_follow_up_in_knowledge_qu
|
||||
assert result.clarification_required is False
|
||||
|
||||
|
||||
def test_semantic_ontology_service_rejects_draft_intent_inside_knowledge_session(monkeypatch) -> None:
|
||||
session_factory = build_session_factory()
|
||||
with session_factory() as db:
|
||||
service = SemanticOntologyService(db)
|
||||
monkeypatch.setattr(
|
||||
service,
|
||||
"_parse_with_model",
|
||||
lambda **kwargs: LlmOntologyParseResult(
|
||||
scenario="expense",
|
||||
intent="draft",
|
||||
confidence=0.91,
|
||||
clarification_required=True,
|
||||
clarification_question="请补充招待对象和票据附件。",
|
||||
missing_slots=["participants", "attachments"],
|
||||
ambiguity=[],
|
||||
entity_hints=[],
|
||||
),
|
||||
)
|
||||
|
||||
result = service.parse(
|
||||
OntologyParseRequest(
|
||||
query="我要去北京出差3天,一共可以报销多少钱?",
|
||||
user_id="pytest",
|
||||
context_json={
|
||||
"role_codes": ["employee"],
|
||||
"name": "曹笑竹",
|
||||
"grade": "P3",
|
||||
"session_type": "knowledge",
|
||||
},
|
||||
)
|
||||
)
|
||||
|
||||
assert result.scenario == "knowledge"
|
||||
assert result.intent == "query"
|
||||
assert result.clarification_required is False
|
||||
assert result.clarification_question is None
|
||||
|
||||
|
||||
def test_semantic_ontology_service_prefers_expense_for_customer_entertainment_narrative() -> None:
|
||||
session_factory = build_session_factory()
|
||||
with session_factory() as db:
|
||||
|
||||
Reference in New Issue
Block a user