空运锁舱按报价来源出站,航线回 2 视为不用 TMS。补陆运常用线路超时,海运举例行不再当成已选分类。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -22,6 +22,7 @@ from agent.routing.group_intent import (
|
||||
INTENT_NEGOTIATE,
|
||||
INTENT_OTHER,
|
||||
INTENT_QUOTE,
|
||||
_exact_tms_choice,
|
||||
_hint_confirm_tms,
|
||||
_hint_deal_outcome,
|
||||
_hint_tms_choice,
|
||||
@@ -94,6 +95,10 @@ def classify_air_group_text(
|
||||
locked = _hint_lock_or_release(raw)
|
||||
if locked:
|
||||
return locked
|
||||
# 本单已有 TMS 报价时,航线回「2」是选不用 TMS,不是把价格改成 2。
|
||||
exact = _exact_tms_choice(raw)
|
||||
if exact:
|
||||
return exact
|
||||
# wo_plus_deal_not_activate:工单号+成交跟进同一句先关单,不能只当激活。
|
||||
closed = _hint_deal_outcome(raw)
|
||||
if copy.extract_work_order_no(raw) and closed:
|
||||
|
||||
@@ -134,6 +134,10 @@ def classify_group_text(
|
||||
raw = (text or "").strip()
|
||||
if not raw:
|
||||
return INTENT_OTHER
|
||||
# 问句让回 1 或 2。整句就是选项时先认,不能把「2」抽成价格。
|
||||
exact = _exact_tms_choice(raw)
|
||||
if exact:
|
||||
return exact
|
||||
try:
|
||||
from agent.config import get_settings
|
||||
|
||||
@@ -184,7 +188,20 @@ def classify_group_text(
|
||||
|
||||
|
||||
def _norm_intent_text(text: str) -> str:
|
||||
return (text or "").replace(" ", "").replace(" ", "").lower()
|
||||
"""去掉空格和 @询价小助手,方便整句就是「2」时对上选项。"""
|
||||
blob = (text or "").replace(" ", "").replace(" ", "").lower()
|
||||
blob = blob.replace("@询价小助手", "").replace("询价小助手", "")
|
||||
return blob.strip()
|
||||
|
||||
|
||||
def _exact_tms_choice(text: str) -> str:
|
||||
"""整句只是 1 / 2 / 第一个 / 第二个。这是在选题,不是报价金额。"""
|
||||
blob = _norm_intent_text(text)
|
||||
if blob in _KEEP_CHOICE:
|
||||
return INTENT_KEEP_TMS
|
||||
if blob in _DROP_CHOICE:
|
||||
return INTENT_DROP_TMS
|
||||
return ""
|
||||
|
||||
|
||||
def _hint_confirm_tms(text: str) -> str:
|
||||
|
||||
Reference in New Issue
Block a user