落地销售调价:按自然语言改价并单独记销售价,拉群和后台不再把调后价当成 TMS 原价。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -32,14 +32,16 @@ def _front_bookmark(sess) -> bool:
|
||||
return phase in {"clarify", "need_mode", "need_land_options", "wait_confirm"}
|
||||
|
||||
|
||||
def _pick_text_flow(*, sender_id: str, text: str, injected_mode: str = ""):
|
||||
def _pick_text_flow(*, sender_id: str, text: str, injected_mode: str = "", prefer_quoted: bool = False):
|
||||
"""
|
||||
按当前书签或本句运输方式选空运/海运/陆运流程。
|
||||
|
||||
陆运核对卡上的确定优先于旧海运书签,避免「确定」被海运/空运吃掉。
|
||||
A 已判成调价时交给当前已报价工单,避免旧海运书签抢走。
|
||||
图片识图在 Worker 写下的补问书签,HTTP 必须从 Redis 读到,否则「托盘」会变成再问运输方式。
|
||||
"""
|
||||
from agent.schema.land_options import looks_like_confirm
|
||||
from agent.policy.quote_adjust_ops import quoted_adjust_flow
|
||||
|
||||
land = get_land_text_flow()
|
||||
if looks_like_confirm(text):
|
||||
@@ -49,6 +51,10 @@ def _pick_text_flow(*, sender_id: str, text: str, injected_mode: str = ""):
|
||||
retry = land.restore_tms_retry_session(sender_id)
|
||||
if retry:
|
||||
return land
|
||||
if prefer_quoted:
|
||||
quoted = quoted_adjust_flow(sender_id)
|
||||
if quoted is not None:
|
||||
return quoted
|
||||
sea = get_sea_text_flow()
|
||||
air = get_air_text_flow()
|
||||
sea_sess = sea.session_of(sender_id)
|
||||
@@ -133,10 +139,12 @@ def handle_text_inquiry(
|
||||
chat_fn=None,
|
||||
flow=None,
|
||||
store=None,
|
||||
prefer_quoted: bool = False,
|
||||
) -> str:
|
||||
"""
|
||||
处理一条私聊文字询价。
|
||||
|
||||
prefer_quoted:A 已判成调价时交给当前已报价工单。
|
||||
须已有 sender_id。副作用:outbox 多条回复;主账经 flow.ledger。
|
||||
返回:流程阶段名。
|
||||
"""
|
||||
@@ -152,6 +160,7 @@ def handle_text_inquiry(
|
||||
sender_id=message.sender_id,
|
||||
text=message.content or "",
|
||||
injected_mode=injected_mode,
|
||||
prefer_quoted=prefer_quoted,
|
||||
)
|
||||
replies: list[str] = []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user