Files
X-Financial/server/src/app/services/scenes/gate_rules.py

39 lines
1.0 KiB
Python
Raw Normal View History

from __future__ import annotations
from enum import Enum
class GateRule(str, Enum):
"""门控规则:决定场景如何参与 gate_classify 的裁决。"""
OFF_TOPIC = "off_topic"
"""非业务输入,走 off_topic_reply。"""
CHOICE = "choice"
"""明确的业务选择,命中 signal_keywords 即生效。"""
AMBIGUOUS_FLOW = "ambiguous_flow"
"""话术歧义,走候选流程确认。"""
MODEL_ONLY = "model_only"
"""只走 LLM function call,不参与规则匹配(如申请/报销的复杂识别)。"""
class SceneRoute(str, Enum):
"""路由策略:gate_classify 裁决后决定走图的哪条边。"""
HANDLER_ONLY = "handler_only"
"""不走 LLM,直接执行 handler(查询/命令类场景)。"""
MODEL_INTENT = "model_intent"
"""走 LLM function call(申请/报销类场景)。"""
OFF_TOPIC = "off_topic"
"""走 off_topic 回复。"""
RESUME = "resume"
"""走确定性上下文恢复。"""
AMBIGUOUS = "ambiguous"
"""走候选流程确认。"""