机器人显示名与站点标题可配;多段联运列表投影;协同群监听对账;工单附件落存;模板与工单后台补强
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -103,7 +103,12 @@ def handle_group_inbound(
|
||||
or ""
|
||||
).upper()
|
||||
if line == "MULTI":
|
||||
from agent.policy.multi_group_ops import bot_sender_when_air_multi, handle_multi_inbound, sender_mode
|
||||
from agent.policy.multi_group_ops import (
|
||||
apply_multi_file,
|
||||
bot_sender_when_air_multi,
|
||||
handle_multi_inbound,
|
||||
sender_mode,
|
||||
)
|
||||
|
||||
if not (
|
||||
_sender_allowed(ticket, message.sender_id)
|
||||
@@ -111,6 +116,22 @@ def handle_group_inbound(
|
||||
):
|
||||
logger.info("group_inbound 多段忽略非成员 sender=%s", message.sender_id)
|
||||
return "group_ignore"
|
||||
kind_multi = (message.msg_type or "text").lower()
|
||||
# 附件走归段落库;禁止把文件名塞进文字报价。
|
||||
if kind_multi in {"file", "image", "video"}:
|
||||
media = dict(message.media or {})
|
||||
filename = str(
|
||||
media.get("filename") or media.get("FileName") or (message.content or "")
|
||||
).strip()
|
||||
with bot_sender_when_air_multi(ticket):
|
||||
return apply_multi_file(
|
||||
flow=engine,
|
||||
ticket=ticket,
|
||||
chat_id=chat_id,
|
||||
sender_id=message.sender_id,
|
||||
filename=filename,
|
||||
media=media,
|
||||
)
|
||||
# 会话存档听到的报价也走这里。含空运时群是机器人建的,必须改走桥才能发得出去。
|
||||
with bot_sender_when_air_multi(ticket):
|
||||
return handle_multi_inbound(
|
||||
@@ -142,6 +163,20 @@ def handle_group_inbound(
|
||||
|
||||
sess = _session_of_ticket(engine, ticket)
|
||||
if is_handoff_ticket(ticket, sess):
|
||||
# 转人工后不再跟报价/成交/补字段,但「解散群」仍要执行,否则协同群清不掉。
|
||||
from agent.routing.group_intent import INTENT_DISSOLVE, classify_group_text
|
||||
|
||||
kind0 = (message.msg_type or "text").lower()
|
||||
if kind0 in {"", "text"} and (
|
||||
classify_group_text(message.content or "", injected=injected_intent)
|
||||
== INTENT_DISSOLVE
|
||||
):
|
||||
logger.info(
|
||||
"group_inbound 转人工仍解散 wo=%s chat=%s",
|
||||
ticket_no(ticket),
|
||||
chat_id,
|
||||
)
|
||||
return dissolve_group(flow=engine, ticket=ticket, sess=sess)
|
||||
logger.info(
|
||||
"group_inbound 转人工不再跟 wo=%s chat=%s",
|
||||
ticket_no(ticket),
|
||||
@@ -221,12 +256,13 @@ def handle_group_inbound(
|
||||
text=message.content or "",
|
||||
)
|
||||
if intent == INTENT_CONFIRM_TMS:
|
||||
return apply_confirm_tms_quote(
|
||||
phase = apply_confirm_tms_quote(
|
||||
flow=engine,
|
||||
ticket=ticket,
|
||||
sender_id=message.sender_id,
|
||||
sess=sess,
|
||||
)
|
||||
return phase
|
||||
if intent in {INTENT_KEEP_TMS, INTENT_DROP_TMS}:
|
||||
return apply_tms_quote_choice(
|
||||
flow=engine,
|
||||
|
||||
Reference in New Issue
Block a user