newtw5
This commit is contained in:
@@ -286,11 +286,21 @@ class SystemOrchestrator:
|
||||
|
||||
# E. 发送并记录时间
|
||||
if std_res.should_reply:
|
||||
# 关键修复:补全发送时的元数据,解决日志 customer_id 为空的问题
|
||||
std_res.metadata = {"acc_id": acc_id, "acc_type": acc_type}
|
||||
|
||||
# 转接场景:先发一句安抚话,再发转接指令
|
||||
if "[转移会话]" in std_res.reply_content:
|
||||
greet = StandardResponse(
|
||||
reply_content="收到,我叫设计师来看下哈",
|
||||
metadata={"acc_id": acc_id, "acc_type": acc_type}
|
||||
)
|
||||
await self.qianniu_adapter.translate_outbound(greet, user_id)
|
||||
await repo.save_chat(platform, user_id, greet.reply_content, "out", acc_id=acc_id)
|
||||
await asyncio.sleep(0.5)
|
||||
|
||||
await self.qianniu_adapter.translate_outbound(std_res, user_id)
|
||||
await repo.save_chat(platform, user_id, std_res.reply_content, "out", acc_id=acc_id)
|
||||
|
||||
|
||||
if "[转移会话]" in std_res.reply_content:
|
||||
self._last_transfer_time[session_key] = time.time()
|
||||
|
||||
|
||||
@@ -86,7 +86,9 @@ class CustomerServiceBrain:
|
||||
"3. **非业务问题**:如果客户问招聘、合作、闲聊等与做图无关的话题,礼貌拒绝。\n"
|
||||
"4. **客户说没有参考图**:直接转人工:'好的,我这就叫设计师帮您找哈'。\n"
|
||||
"5. **客户问尺寸/能否打印/退款**:直接转人工:'这个设计师帮您看下哈'。\n"
|
||||
"6. 转接时机:收到图片并明确需求后,立即调用转人工工具。\n"
|
||||
"6. **转接时机(严格两步)**:必须同时满足【有图】+【客户明确说了要找原图/修复/具体要求】才能转接。\n"
|
||||
" 客户只发了图但没说需求 → 必须先问'亲亲这张是找原图还是修复哈?'\n"
|
||||
" 客户说了'有吗'、'能找吗' → 这不算明确需求,要追问'是要找原图还是高清修复呢?'\n"
|
||||
"7. **下线安抚**:只有工具返回ERROR时才能提设计师不在。根据错误码区分:\n"
|
||||
" - ERROR_DESIGNER_NOT_STARTED → 说'还没上班,记下了上班马上处理'(严禁说下班)\n"
|
||||
" - ERROR_DESIGNER_OFFLINE → 说'下班了,需求记下明天回'\n"
|
||||
@@ -131,11 +133,12 @@ class CustomerServiceBrain:
|
||||
try:
|
||||
user_content = msg.content or ""
|
||||
|
||||
# 客户已发图:在上下文中明确告知 AI,避免再回"先发图"
|
||||
# 客户已发图:告知 AI 图已收到,引导问需求,但不要直接转接
|
||||
if msg.image_urls:
|
||||
user_content = (
|
||||
f"【系统通知:客户已发送 {len(msg.image_urls)} 张图片,不要再让客户发图!"
|
||||
f"请直接问客户需求(找原图还是修复),然后转接设计师】\n{user_content}"
|
||||
f"【系统通知:客户已发送 {len(msg.image_urls)} 张图片,图已收到不要再让客户发图。"
|
||||
f"你现在必须先问客户:这张是找原图还是高清修复?有什么具体要求?"
|
||||
f"等客户明确回答后才能转接,严禁跳过问需求直接转接!】\n{user_content}"
|
||||
)
|
||||
|
||||
recent_context = ""
|
||||
|
||||
Reference in New Issue
Block a user