refactor(server): user_agent/steward/ocr 等服务重构并适配关联任务
- user_agent 拆分 application/locations/knowledge/response/review 四个子模块,接入申请位置语义与关联草稿分支 - steward planner/runtime/slot/plan_builder 决策链路重构,travel_reimbursement_calculator/orchestrator_expense_query 适配 - ocr/document_preview/document_intelligence/receipt_folder 复用预览与资产缓存,expense_claim_draft_flow/application_handoff 适配 - pyproject.toml 新增依赖,paddleocr bootstrap 脚本与 server_start.sh 调整 - 更新差旅/交通/通信等财务规则表,同步 document_intelligence/ocr/receipt_folder/user_agent 等测试
This commit is contained in:
@@ -335,7 +335,7 @@ class StewardPlannerFallbackMixin:
|
||||
flow_id="travel_application",
|
||||
label="先发起出差申请",
|
||||
confidence=0.86,
|
||||
reason="已先查询你名下可关联的差旅申请单,暂未查到可关联单据,因此应先申请单据。",
|
||||
reason="已先查询您名下可关联的差旅申请单,暂未查到可关联单据,因此应先申请单据。",
|
||||
ontology_fields=application_fields,
|
||||
missing_fields=self._resolve_missing_fields("expense_application", application_fields),
|
||||
)
|
||||
@@ -345,7 +345,7 @@ class StewardPlannerFallbackMixin:
|
||||
if gate.get("checked"):
|
||||
candidate_count = int(gate.get("candidate_count") or 0)
|
||||
reimbursement_label = "关联已有申请单并发起报销"
|
||||
reimbursement_reason = f"已先查到 {candidate_count} 个可关联申请单,选择后会先请你关联具体单据。"
|
||||
reimbursement_reason = f"已先查到 {candidate_count} 个可关联申请单,选择后会先请您关联具体单据。"
|
||||
return [
|
||||
StewardCandidateFlow(
|
||||
flow_id="travel_application",
|
||||
@@ -390,10 +390,10 @@ class StewardPlannerFallbackMixin:
|
||||
@staticmethod
|
||||
def _build_pending_flow_reason(gate: dict[str, Any]) -> str:
|
||||
if gate.get("checked") and int(gate.get("candidate_count") or 0) <= 0:
|
||||
return "我已经先查询你名下可关联的差旅申请单,未查到可关联单据,所以当前应先申请单据。"
|
||||
return "我已先查询您名下可关联的差旅申请单,未查到可关联单据,所以当前应先申请单据。"
|
||||
if gate.get("checked"):
|
||||
candidate_count = int(gate.get("candidate_count") or 0)
|
||||
return f"我已经先查询你名下的差旅申请单,查到 {candidate_count} 个可关联申请单,需要你确认是否关联单据后发起报销。"
|
||||
return f"我已先查询您名下的差旅申请单,查到 {candidate_count} 个可关联申请单,需要您确认是否关联单据后发起报销。"
|
||||
return "当前话术描述了出差事项,但没有明确说明要补办申请还是发起报销。"
|
||||
|
||||
@staticmethod
|
||||
@@ -404,10 +404,10 @@ class StewardPlannerFallbackMixin:
|
||||
candidate_count = int(gate.get("candidate_count") or 0)
|
||||
return (
|
||||
f"我已先查询可关联申请单,查到 {candidate_count} 个可关联申请单;"
|
||||
"你可以选择关联已有申请单发起报销,或改为补办新的出差申请。"
|
||||
"您可以选择关联已有申请单发起报销,也可以改为补办新的出差申请。"
|
||||
)
|
||||
return (
|
||||
"我识别到这是一次出差事项,但还不能确定你要做的是"
|
||||
"我识别到这是一次出差事项,但还不能确定您要做的是"
|
||||
"**补办出差申请**还是**发起费用报销**。请先选择一个方向。"
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user