refactor: remove action_required/action_items/key_points, keep summary concise

This commit is contained in:
earthjasonlin committed 2026-07-11 19:46:18 +08:00
1 parent 1957eb2a73
commit a992af0e02
2 files changed
+2 -19

No files matched your search

-14
View File
@@ -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
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.