落地私聊附件询价:发卡走 H5 收 Excel/PDF,认成口播再复用三线文字流程,避免附件卡在识别或退成纯文本。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -15,6 +15,7 @@ from agent.handlers import abnormal, card_action, close_deal, continue_thread, n
|
||||
from agent.handlers.echo_text import handle_echo_text
|
||||
from agent.handlers.group_collab import handle_group_collab
|
||||
from agent.handlers.image_inquiry import handle_image_inquiry
|
||||
from agent.handlers.attachment_inquiry import handle_attachment_inquiry
|
||||
from agent.handlers.text_inquiry import handle_text_inquiry, handle_text_other, is_land_confirm_action
|
||||
from agent.routing.decision import RouteDecision
|
||||
|
||||
@@ -57,6 +58,11 @@ def _wrap_new(message: InboundMessage) -> None:
|
||||
new_inquiry.handle_new_inquiry(message)
|
||||
|
||||
|
||||
def _wrap_attachment(message: InboundMessage) -> None:
|
||||
"""私聊附件询价:发卡等材料,认完当口播新开,复用文字流程。"""
|
||||
handle_attachment_inquiry(message)
|
||||
|
||||
|
||||
def _wrap_image(message: InboundMessage) -> None:
|
||||
"""私聊图片询价:认图后当口播新开,复用文字流程。"""
|
||||
handle_image_inquiry(message)
|
||||
@@ -117,7 +123,7 @@ HANDLER_REGISTRY: dict[str, HandlerFn] = {
|
||||
"echo_text": _wrap_echo,
|
||||
"ordinary_text_inquiry": _wrap_text_inquiry,
|
||||
"ordinary_text_other": _wrap_text_other,
|
||||
"attachment_inquiry": _wrap_new,
|
||||
"attachment_inquiry": _wrap_attachment,
|
||||
"image_inquiry": _wrap_image,
|
||||
"multi_segment_transport": _wrap_new,
|
||||
"tms_read_only_quote": _wrap_continue,
|
||||
@@ -211,11 +217,24 @@ def dispatch_inbound(message: InboundMessage, decision: RouteDecision) -> str:
|
||||
|
||||
kind = (message.msg_type or "text").lower()
|
||||
if kind == "image":
|
||||
from agent.handlers.attachment_inquiry import is_active_attachment_wait, join_attachment_image
|
||||
|
||||
if is_active_attachment_wait(message.sender_id):
|
||||
join_attachment_image(message)
|
||||
return "attachment_inquiry"
|
||||
handle_image_inquiry(message)
|
||||
return "image_inquiry"
|
||||
if kind in {"text", ""}:
|
||||
from agent.handlers.attachment_inquiry import append_attach_text, is_active_attachment_wait
|
||||
from agent.handlers.image_inquiry import append_wave_text, is_active_image_wave
|
||||
|
||||
if is_active_attachment_wait(message.sender_id) and (message.content or "").strip():
|
||||
if decision.intent == "attachment_inquiry":
|
||||
handle_attachment_inquiry(message)
|
||||
return "attachment_inquiry"
|
||||
append_attach_text(message.sender_id, message.content or "")
|
||||
logger.info("dispatch 附件波次收字 sender=%s", message.sender_id)
|
||||
return "attach_wave_follow_text"
|
||||
if is_active_image_wave(message.sender_id) and (message.content or "").strip():
|
||||
append_wave_text(message.sender_id, message.content or "")
|
||||
logger.info("dispatch 图片波次收字 sender=%s", message.sender_id)
|
||||
|
||||
Reference in New Issue
Block a user