fix(application-form-fill): 优先路由填表提示并支持rar预览

This commit is contained in:
2026-06-07 20:14:23 +08:00
parent 82c33e513f
commit ac5cf8bf7e
5 changed files with 145 additions and 2 deletions

View File

@@ -51,6 +51,10 @@ class SkillRoute:
def route_message_intent(conversation: Conversation, content: str) -> SkillRoute:
deterministic_route = _deterministic_workflow_route(conversation, content)
if deterministic_route:
return deterministic_route
attachments = list(_active_attachments(conversation))
try:
route = _route_with_llm(conversation, content, attachments)
@@ -75,6 +79,35 @@ def route_message_intent(conversation: Conversation, content: str) -> SkillRoute
return _route_with_rules(conversation, content)
def _deterministic_workflow_route(conversation: Conversation, content: str) -> SkillRoute | None:
if _matches_application_form_fill(content):
return SkillRoute(
action=FORM_FILL_WORKFLOW_TYPE,
workflow_type=FORM_FILL_WORKFLOW_TYPE,
confidence=0.9,
reason="命中明确申报文件自动填表关键词。",
source="rule_preflight",
)
if _matches_regulatory_review(content):
return SkillRoute(
action="regulatory_review",
workflow_type="regulatory_review",
confidence=0.9,
reason="命中明确法规核查关键词。",
source="rule_preflight",
)
file_summary = evaluate_file_summary_trigger(conversation, content)
if file_summary.should_start or file_summary.reason == "missing_attachment":
return SkillRoute(
action="file_summary",
workflow_type="file_summary",
confidence=0.8,
reason=file_summary.reason,
source="rule_preflight",
)
return None
def _route_with_llm(
conversation: Conversation,
content: str,