auto-sync: 2026-05-24 19:49:16
This commit is contained in:
+6
-20
@@ -21,41 +21,27 @@ logger = logging.getLogger("moziplus-v2.spawner")
|
||||
|
||||
# ── Prompt 模板 ──
|
||||
|
||||
# Mail 专用模板:inform 类型(纯通知,读完确认即可)
|
||||
# Mail 专用模板:inform 类型(纯通知,状态由系统管理)
|
||||
MAIL_INFORM_TEMPLATE = """你收到一封飞鸽传书(纯通知,不需要回复)。
|
||||
|
||||
发件者: {from_agent}
|
||||
主题: {title}
|
||||
内容: {text}
|
||||
|
||||
读完确认即可,不需要回复。
|
||||
|
||||
操作:
|
||||
1. 确认收到:
|
||||
curl -X POST http://{api_host}:{api_port}/api/projects/_mail/tasks/{task_id}/status \\\n -H 'Content-Type: application/json' \\\n -d '{{"status": "working", "agent": "{agent_id}"}}'
|
||||
|
||||
2. 标记完成:
|
||||
curl -X POST http://{api_host}:{api_port}/api/projects/_mail/tasks/{task_id}/status \\\n -H 'Content-Type: application/json' \\\n -d '{{"status": "done", "agent": "{agent_id}"}}'
|
||||
已阅即可,无需操作。
|
||||
"""
|
||||
|
||||
# Mail 专用模板:request 类型(需要处理并回复)
|
||||
# Mail 专用模板:request 类型(需要处理并回复,状态由系统管理)
|
||||
MAIL_REQUEST_TEMPLATE = """你收到一封飞鸽传书,需要你处理并回复。
|
||||
|
||||
发件者: {from_agent}
|
||||
主题: {title}
|
||||
内容: {text}
|
||||
|
||||
请阅读内容,根据需要处理后回复发件者。
|
||||
请处理后回复发件者:
|
||||
curl -s -X POST http://localhost:8083/api/mail \\\n -H 'Content-Type: application/json' \\\n -d '{{"from": "{agent_id}", "to": "{from_agent}", "title": "回复: {title}", "text": "你的回复内容", "type": "inform", "in_reply_to": "{task_id}"}}'
|
||||
|
||||
操作:
|
||||
1. 开始处理:
|
||||
curl -X POST http://{api_host}:{api_port}/api/projects/_mail/tasks/{task_id}/status \\\n -H 'Content-Type: application/json' \\\n -d '{{"status": "working", "agent": "{agent_id}"}}'
|
||||
|
||||
2. 回复发件者(⚠️ 回复邮件 type 用 inform,避免循环):
|
||||
curl -X POST http://localhost:8083/api/mail \\\n -H 'Content-Type: application/json' \\\n -d '{{"from": "{agent_id}", "to": "{from_agent}", "title": "回复: {title}", "text": "你的回复内容", "type": "inform", "in_reply_to": "{task_id}"}}'
|
||||
|
||||
3. 标记完成:
|
||||
curl -X POST http://{api_host}:{api_port}/api/projects/_mail/tasks/{task_id}/status \\\n -H 'Content-Type: application/json' \\\n -d '{{"status": "done", "agent": "{agent_id}"}}'
|
||||
⚠️ 将"你的回复内容"替换为实际回复。type 必须用 inform 防止循环。
|
||||
"""
|
||||
|
||||
SPAWN_PROMPT_TEMPLATE = """你收到一个 v2.6 黑板任务。请严格按照下面的步骤执行。
|
||||
|
||||
Reference in New Issue
Block a user