checkpoint: 提交当前工作区代码(同义词配置初版 + 既有流程改动)
- 新增 inq_synonym 表、62组同义词种子与智能体只读接口 - Python 同义词加载/归一化与 1板/2箱 机读 - 同步当前分支既有协作、报价识别、陆运等改动
This commit is contained in:
@@ -52,6 +52,8 @@ class MemoryTicket:
|
||||
collab_chat_id: str = ""
|
||||
collab_facts: dict[str, str] = field(default_factory=dict)
|
||||
collab_member_ids: list[str] = field(default_factory=list)
|
||||
# 有报价/补字段等互动的产品/航线;处理人列只认这份,不认全部群成员。
|
||||
collab_actor_ids: list[str] = field(default_factory=list)
|
||||
product_ids: list[str] = field(default_factory=list)
|
||||
product_names: list[str] = field(default_factory=list)
|
||||
collab_ended: bool = False
|
||||
@@ -792,6 +794,7 @@ class MemoryLedger:
|
||||
kind: str = "",
|
||||
raw_text: str = "",
|
||||
raw_source: str = "",
|
||||
sender_id: str = "",
|
||||
) -> dict[str, Any]:
|
||||
"""手工报价 / 销售调价盖 TMS 价。remark/kind 只给 HTTP 主账记流水。"""
|
||||
_ = remark, kind
|
||||
@@ -799,7 +802,7 @@ class MemoryLedger:
|
||||
work_order_no=work_order_no, quote=quote, to_status=to_status
|
||||
)
|
||||
# 单测里也要能回看产品原话;主账落 inq_quote.raw_text,内存票落在 quote 快照。
|
||||
if out.get("ok") and (raw_text or raw_source):
|
||||
if out.get("ok") and (raw_text or raw_source or sender_id):
|
||||
with self._lock:
|
||||
ticket = self._tickets.get(work_order_no)
|
||||
if ticket is not None:
|
||||
@@ -807,6 +810,9 @@ class MemoryLedger:
|
||||
ticket.quote["raw_text"] = raw_text
|
||||
if raw_source:
|
||||
ticket.quote["raw_source"] = raw_source
|
||||
uid = (sender_id or "").strip()
|
||||
if uid and uid not in ticket.collab_actor_ids:
|
||||
ticket.collab_actor_ids.append(uid)
|
||||
return out
|
||||
|
||||
def patch_collab_facts(
|
||||
@@ -817,11 +823,13 @@ class MemoryLedger:
|
||||
sender_id: str = "",
|
||||
) -> dict[str, Any]:
|
||||
"""合并协同字段。不改六态、不写报价版本。"""
|
||||
_ = sender_id
|
||||
with self._lock:
|
||||
ticket = self._tickets.get(work_order_no)
|
||||
if ticket is None:
|
||||
return {"ok": False, "error": "ticket_not_found"}
|
||||
uid = (sender_id or "").strip()
|
||||
if uid and uid not in ticket.collab_actor_ids:
|
||||
ticket.collab_actor_ids.append(uid)
|
||||
for key, raw in (facts or {}).items():
|
||||
name = str(key or "").strip()
|
||||
if not name:
|
||||
|
||||
Reference in New Issue
Block a user