feat: 增强知识库索引与设置页面模块化拆分

扩展知识库索引任务和 RAG 检索支持增量入库和文档去重,优
化本体检测和规则匹配精度,前端设置页面拆分为 LLM、邮件
和 Hermes 员工同步子面板并重构样式,新增日志详情组件和
知识入库日志模型,补充单元测试覆盖。
This commit is contained in:
caoxiaozhu
2026-05-22 23:47:28 +08:00
parent 88ff04bef8
commit 5b388d08c0
84 changed files with 10170 additions and 2599 deletions

View File

@@ -59,6 +59,20 @@ class UserAgentReviewProfileMixin:
manager_name = self._resolve_manager_name(employee)
reason = slot_map.get("reason").value if slot_map.get("reason") else ""
attachments = "".join(self._resolve_attachment_names(payload))
expense_type_code = str(slot_map.get("expense_type").normalized_value if slot_map.get("expense_type") else "").strip()
customer_name = str(slot_map.get("customer_name").value if slot_map.get("customer_name") else "").strip()
merchant_name = str(slot_map.get("merchant_name").value if slot_map.get("merchant_name") else "").strip()
participants = str(slot_map.get("participants").value if slot_map.get("participants") else "").strip()
customer_slot = slot_map.get("customer_name")
participants_slot = slot_map.get("participants")
customer_required = bool(
customer_slot
and (customer_slot.required or customer_slot.status == "missing")
)
participants_required = bool(
participants_slot
and (participants_slot.required or participants_slot.status == "missing")
)
fields = [
UserAgentReviewEditField(
@@ -98,13 +112,20 @@ class UserAgentReviewProfileMixin:
required=False,
group="basic",
),
UserAgentReviewEditField(
key="customer_name",
label="客户名称",
value=slot_map.get("customer_name").value if slot_map.get("customer_name") else "",
placeholder="请输入客户名称",
group="business",
),
]
if expense_type_code == "entertainment" or customer_required or customer_name:
fields.append(
UserAgentReviewEditField(
key="customer_name",
label="客户名称",
value=customer_name,
placeholder="请输入客户名称",
group="business",
)
)
fields.append(
UserAgentReviewEditField(
key="business_location",
label="业务地点",
@@ -112,15 +133,22 @@ class UserAgentReviewProfileMixin:
placeholder="例如:北京 / 客户现场",
required=False,
group="business",
),
UserAgentReviewEditField(
key="merchant_name",
label="酒店/商户",
value=slot_map.get("merchant_name").value if slot_map.get("merchant_name") else "",
placeholder="请输入酒店或商户名称",
required=False,
group="business",
),
)
)
if expense_type_code == "hotel" or merchant_name:
fields.append(
UserAgentReviewEditField(
key="merchant_name",
label="酒店/商户",
value=merchant_name,
placeholder="请输入酒店或商户名称",
required=False,
group="business",
)
)
fields.extend([
UserAgentReviewEditField(
key="amount",
label="金额",
@@ -128,13 +156,20 @@ class UserAgentReviewProfileMixin:
placeholder="例如200.00元",
group="business",
),
UserAgentReviewEditField(
key="participants",
label="参与人员",
value=slot_map.get("participants").value if slot_map.get("participants") else "",
placeholder="例如:客户 2 人,我方 1 人",
group="business",
),
])
if expense_type_code == "entertainment" or participants_required or participants:
fields.append(
UserAgentReviewEditField(
key="participants",
label="参与人员",
value=participants,
placeholder="例如:客户 2 人,我方 1 人",
group="business",
)
)
fields.extend([
UserAgentReviewEditField(
key="reason",
label="事由",
@@ -152,7 +187,7 @@ class UserAgentReviewProfileMixin:
field_type="textarea",
group="attachments",
),
]
])
return fields