feat: complete customer service safety and handover flow

This commit is contained in:
张胜宇
2026-09-11 16:11:30 +08:00
parent 0059701509
commit ef098e6a4b
30 changed files with 1868 additions and 50 deletions
+8
View File
@@ -13,6 +13,10 @@ class AgentRequestMetadata(BaseModel):
ui_entry: str | None = None
# 仅由受理服务写入 Outbox,客户端 API 不接收该字段。
chitchat_streak: int = Field(default=0, ge=0, le=5)
# 客服澄清轮次只来自服务端会话行,客户端不得提交或覆盖。
clarification_round: int = Field(default=0, ge=0, le=2)
# 仅供客服在当前短期会话内消解指代的已脱敏上下文,不是长期记忆或客户画像。
session_context: tuple[str, ...] = Field(default_factory=tuple, max_length=6)
class AgentRequest(BaseModel):
@@ -63,6 +67,8 @@ class AgentDefinition(BaseModel):
allowed_portals: tuple[str, ...] = ()
supported_intents: tuple[str, ...] = ("general",)
requires_model_intent_classification: bool = True
# 长期/画像记忆属于客户数据能力;默认保留既有 Agent 行为,客服需显式关闭。
recalls_customer_memory: bool = True
class ResolvedAgentConfig(BaseModel):
@@ -118,6 +124,8 @@ class CoreResult(BaseModel):
intent: IntentResult | None = None
source_references: tuple[SourceReference, ...] = ()
tool_calls: tuple[ToolCallRecord, ...] = ()
# 请求澄清时由持久化层安全递增会话轮次;达到上限后必须改为人工转接。
clarification_required: bool = False
transfer_required: bool = False
transfer_reason: str | None = None