feat: 新增归档中心页面并完善知识库与报销查询能力
新增前端归档中心视图及相关工具函数,扩充知识库文档分类和 提取器支持多种格式,增强编排器报销查询的多维度检索,优 化本体规则和用户代理审核消息,前端完善报销创建和审批详 情交互细节,补充单元测试覆盖。
This commit is contained in:
@@ -114,6 +114,20 @@ class OntologyDetectionMixin:
|
||||
return "query", 0.24
|
||||
if any(keyword in compact_query for keyword in DRAFT_KEYWORDS):
|
||||
return "draft", 0.26
|
||||
if scenario == "expense" and "报销" in compact_query and any(
|
||||
item.type == "expense_type"
|
||||
and str(item.normalized_value or item.value or "").strip()
|
||||
for item in entities
|
||||
) and not any(
|
||||
keyword in compact_query
|
||||
for keyword in (
|
||||
*QUERY_KEYWORDS,
|
||||
*COMPARE_KEYWORDS,
|
||||
*EXPLAIN_KEYWORDS,
|
||||
*RISK_KEYWORDS,
|
||||
)
|
||||
):
|
||||
return "draft", 0.25
|
||||
if scenario == "expense" and self._is_generic_expense_prompt(compact_query):
|
||||
return "draft", 0.24
|
||||
if any(keyword in compact_query for keyword in COMPARE_KEYWORDS):
|
||||
@@ -220,7 +234,11 @@ class OntologyDetectionMixin:
|
||||
has_expense_signal = any(
|
||||
keyword in compact_query for keyword in EXPENSE_NARRATIVE_KEYWORDS
|
||||
) or "expense_type" in entity_types
|
||||
has_context_signal = bool(time_range.start_date) or "amount" in entity_types
|
||||
has_context_signal = (
|
||||
bool(time_range.start_date)
|
||||
or "amount" in entity_types
|
||||
or ("报销" in compact_query and "expense_type" in entity_types)
|
||||
)
|
||||
|
||||
return has_expense_signal and has_context_signal
|
||||
|
||||
|
||||
Reference in New Issue
Block a user