初始化询价智能体新仓:同步本地工程并排除密钥与 .env。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
linmianxun
2026-09-13 14:30:44 +08:00
co-authored by Cursor
commit 2a14def882
2621 changed files with 393165 additions and 0 deletions
@@ -0,0 +1,37 @@
"""
企微入站归一模型。
本文件职责:定义 InboundMessage,作为 channel → handler 的唯一入站结构。
禁止:在本文件调企微换 ID、写六态、调 LLM。
"""
from __future__ import annotations
from dataclasses import dataclass, field
from typing import Any
@dataclass(frozen=True)
class InboundMessage:
"""
归一后的入站消息(只读)。
sender_id:必须来自入站报文 FromUserName / AIBOT 发送人,禁止事后向企微拉取。
sender_id 为空时不得入业务队列。
message_id:全局去重键;缺省时由调用方用 msg_id/CreateTime 拼。
"""
sender_id: str
message_id: str
content: str
msg_type: str = "text"
chat_id: str = ""
chat_type: str = "single" # single | group
agent_id: str = ""
create_time: int = 0
media: dict[str, Any] = field(default_factory=dict)
raw: dict[str, Any] = field(default_factory=dict)
def has_sender(self) -> bool:
"""是否具备可进入业务的发送人身份。"""
return bool(self.sender_id and self.sender_id.strip())