海运补问保留贸易条款;陆运多车型价表按列回填,车型码不进起始地

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
linmianxun
2026-10-29 10:53:30 +08:00
co-authored by Cursor
parent 56ba8e93b5
commit eca0a7ad93
10 changed files with 809 additions and 18 deletions
+16 -2
View File
@@ -237,13 +237,27 @@ class SeaTextInquiryFlow(AirTextInquiryFlow):
# 刚选定海运时,贸易条款、运输分类要对照定方式前的全部原话,不只看「海运」两个字。
source = waiting_mode_source(sess, text)
# 补问阶段 waiting_mode_source 只给本句;首句里的「港到港」必须拼回去,
# 否则 apply_spoken 会把会话已有条款当成模型冒充删掉(只补货量时再问贸易条款)。
trade_source = source
if sess and getattr(sess, "phase", "") in {"clarify", "wait_confirm", "sensitive_block"}:
trade_source = stack_user_text(getattr(sess, "immutable_text", "") or "", text)
# 整句只回「港到港」是贸易条款举例,不要改写成运输分类。
class_source = "" if short_sea_trade_reply(source) == "港到港" else source
facts = harvest_sea_class(class_source, facts)
# 贸易条款标签行原样优先;整句回复或长句里写了门到门/港到港都要收下。
# 原话没出现这两个词时,模型冒充的门到门、港到港继续丢掉。
facts = apply_spoken_sea_trade_reply(source, facts)
spoken = harvest_spoken_trade_term(source)
# 补问用 trade_source(首句+本句),避免只补货量时丢掉已确认的港到港。
facts = apply_spoken_sea_trade_reply(trade_source, facts)
# 本句显式改条款时覆盖历史(短回门到门/港到港,或写出 FOB/CIF 等)。
short_now = short_sea_trade_reply(text)
if short_now:
facts["贸易条款"] = short_now
else:
spoken_now = harvest_spoken_trade_term(text)
if spoken_now.get("贸易条款"):
facts["贸易条款"] = spoken_now["贸易条款"]
spoken = harvest_spoken_trade_term(trade_source)
if spoken.get("贸易条款") and not str(facts.get("贸易条款") or "").strip():
facts["贸易条款"] = spoken["贸易条款"]
check = validate_required_fields(facts=facts, business_line="SEA")