机器人显示名与站点标题可配;多段联运列表投影;协同群监听对账;工单附件落存;模板与工单后台补强

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
linmianxun
2026-10-19 09:41:59 +08:00
co-authored by Cursor
parent 277cdc1c28
commit 2b528758b4
119 changed files with 6760 additions and 3516 deletions
@@ -71,12 +71,15 @@ _CONFIRM_NO = ("不需要", "不用", "否")
def is_missed_air_bot_at(text: str, *, room_already_air: bool = False) -> bool:
"""
存档里看到用户已经 @ 询价小助手。BOT 长连接没推到时,用这一刀补听。
存档里看到用户已经 @ 机器人显示名。BOT 长连接没推到时,用这一刀补听。
海运拉人卡片也带「询价小助手」,必须排除。闲聊没有 @ 仍不当业务。
显示名以后台 system.bot_display_name 为准,过渡期仍认旧名「询价小助手」。
海运拉人卡片也常带显示名,必须排除。闲聊没有 @ 仍不当业务。
"""
from agent.policy.bot_name import text_mentions_bot
raw = (text or "").strip()
if "询价小助手" not in raw:
if not text_mentions_bot(raw):
return False
if "运输方式:海运" in raw or "运输方式:海运" in raw:
return False
@@ -226,10 +229,12 @@ def cabin_confirm_answer(text: str) -> str:
只认整句(可带工单号和 @)。「不需要」不能被看成「需要」。
返回 yes / no / 空串。空串表示询问作废,调用方按原句继续办。
"""
from agent.policy.bot_name import strip_bot_mention
raw = text or ""
no = copy.extract_work_order_no(raw)
rest = raw.replace(no, "").replace(no.lower(), "")
rest = rest.replace("@询价小助手", "").replace("询价小助手", "")
rest = strip_bot_mention(rest)
rest = "".join(ch for ch in rest if ch.isalnum() or "\u4e00" <= ch <= "\u9fff")
if rest in _CONFIRM_NO:
return "no"
@@ -252,14 +257,16 @@ def _hint_lock_or_release(text: str) -> str:
def _only_work_order(text: str) -> bool:
"""
去掉工单号和 @询价小助手 后几乎没字,当作激活/切单。
去掉工单号和 @机器人显示名 后几乎没字,当作激活/切单。
销售常按话术复制「工单编号WO…@询价小助手」;残留「工单编号」不算业务意图。
销售常按话术复制「工单编号WO…@显示名」;残留「工单编号」不算业务意图。
运行证据:only_wo=false 后走 extract_product_quote→product_quote→航线岗拒绝。
"""
from agent.policy.bot_name import strip_bot_mention
no = copy.extract_work_order_no(text)
rest = (text or "").replace(no, "").replace(no.lower(), "")
rest = rest.replace("@询价小助手", "").replace("询价小助手", "")
rest = strip_bot_mention(rest)
for noise in ("工单编号", "工单号", "编号"):
rest = rest.replace(noise, "")
rest = "".join(ch for ch in rest if ch.isalnum() or "\u4e00" <= ch <= "\u9fff")
+6 -3
View File
@@ -248,9 +248,12 @@ def classify_group_text(
def _norm_intent_text(text: str) -> str:
"""去掉空格和 @询价小助手,方便整句就是「2」时对上选项。"""
blob = (text or "").replace(" ", "").replace(" ", "").lower()
blob = blob.replace("@询价小助手", "").replace("询价小助手", "")
"""去掉空格和 @机器人显示名,方便整句就是「2」时对上选项。"""
from agent.policy.bot_name import strip_bot_mention
# 先剥显示名再 lower:否则「智报通AIQ」会变成「智报通aiq」剥不掉。
blob = strip_bot_mention(text or "")
blob = blob.replace(" ", "").replace(" ", "").lower()
return blob.strip()