refactor: remove action_required/action_items/key_points, keep summary concise
This commit is contained in:
@@ -9,9 +9,6 @@ from src.retry import retry
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
_priority_icon = {"high": "🔴", "medium": "🟡", "low": "🟢"}
|
||||
|
||||
# msg_id -> email context
|
||||
_email_contexts: dict[int, dict] = {}
|
||||
# chat_id -> conversation state
|
||||
_conversations: dict[int, dict] = {}
|
||||
@@ -124,26 +121,15 @@ def _format_verification(data: dict, account_email: str = "") -> str:
|
||||
|
||||
|
||||
def _format_normal(data: dict, account_email: str = "") -> str:
|
||||
priority = data.get("priority", "medium")
|
||||
icon = _priority_icon.get(priority, "⚪")
|
||||
lines = [
|
||||
f"*📧 {_escape(data.get('subject', '邮件摘要'))}*",
|
||||
"━━━━━━━━━━━━━━━━━━",
|
||||
f"*收件人:* {_escape(data.get('recipient', '未知'))}",
|
||||
f"*发件人:* {_escape(data.get('sender', '未知'))}",
|
||||
f"*账户:* {_escape(account_email)}",
|
||||
f"*优先级:* {icon} {priority.upper()}",
|
||||
"",
|
||||
_escape(data.get("summary", "")),
|
||||
"",
|
||||
]
|
||||
if data.get("action_required"):
|
||||
lines.append("*📌 需要处理:* 是")
|
||||
for item in data.get("action_items", []):
|
||||
lines.append(f" \\- {_escape(item)}")
|
||||
lines.append("")
|
||||
for p in data.get("key_points", []):
|
||||
lines.append(f" \\- {_escape(p)}")
|
||||
return "\n".join(lines)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user