Version: 0.8.7.dev.260402
后端: 1.Plan节点实现两阶段LLM调用:Phase1无thinking快速评估复杂度,复杂任务自动开启Phase2深度规划 2.Execute节点新增GoalCheck自省机制:LLM输出next_plan/done时必须附带对照done_when的完成验证,为空则追加修正重试 前端:无 仓库:无
This commit is contained in:
@@ -19,6 +19,8 @@ const planSystemPrompt = `
|
||||
4. 若你认为计划已经完整可执行,请返回 action=plan_done,并附带完整 plan_steps。
|
||||
5. plan_steps 必须使用自然语言,便于后端将完整 plan 重新注入到后续上下文顶部。
|
||||
6. 只输出 JSON,不要输出 markdown,不要输出额外解释,不要在 JSON 外再补文字。
|
||||
7. 每次输出前先评估任务复杂度:simple(简单明确,无复杂依赖)、moderate(多步操作,需要一定推理)、complex(需要深度推理、多方案比较或复杂依赖关系)。
|
||||
8. 根据复杂度判断 need_thinking:你是否需要深度思考才能生成高质量计划?当不确定时倾向于 false。
|
||||
|
||||
你会看到:
|
||||
- 当前阶段与轮次信息
|
||||
@@ -78,35 +80,43 @@ func BuildPlanDecisionContractText() string {
|
||||
- speak:给用户看的话;若 action=%s,这里通常就是要追问用户的问题
|
||||
- action:只能是 %s / %s / %s
|
||||
- reason:给后端和日志看的简短说明
|
||||
- complexity:任务复杂度,只能是 simple / moderate / complex
|
||||
- need_thinking:是否需要深度思考才能生成高质量计划,只能是 true / false
|
||||
- plan_steps:仅当 action=%s 时允许返回;返回时必须是完整计划,不是增量
|
||||
- plan_steps[].content:步骤正文,必填
|
||||
- plan_steps[].done_when:可选,建议写“什么情况下算这一步做完”
|
||||
- plan_steps[].done_when:可选,建议写”什么情况下算这一步做完”
|
||||
|
||||
合法示例:
|
||||
{
|
||||
"speak": "我先把计划再收束一下。",
|
||||
"action": "%s",
|
||||
"reason": "当前信息已足够继续规划"
|
||||
“speak”: “我先把计划再收束一下。”,
|
||||
“action”: “%s”,
|
||||
“reason”: “当前信息已足够继续规划”,
|
||||
“complexity”: “moderate”,
|
||||
“need_thinking”: false
|
||||
}
|
||||
|
||||
{
|
||||
"speak": "你更希望我优先安排今天,还是按整周来规划?",
|
||||
"action": "%s",
|
||||
"reason": "当前时间范围仍不明确"
|
||||
“speak”: “你更希望我优先安排今天,还是按整周来规划?”,
|
||||
“action”: “%s”,
|
||||
“reason”: “当前时间范围仍不明确”,
|
||||
“complexity”: “simple”,
|
||||
“need_thinking”: false
|
||||
}
|
||||
|
||||
{
|
||||
"speak": "计划已经整理好了,我先给你确认一下。",
|
||||
"action": "%s",
|
||||
"reason": "当前计划已具备执行条件",
|
||||
"plan_steps": [
|
||||
“speak”: “计划已经整理好了,我先给你确认一下。”,
|
||||
“action”: “%s”,
|
||||
“reason”: “当前计划已具备执行条件”,
|
||||
“complexity”: “simple”,
|
||||
“need_thinking”: false,
|
||||
“plan_steps”: [
|
||||
{
|
||||
"content": "先确认本周可用时间范围",
|
||||
"done_when": "拿到明确的可用时间段列表"
|
||||
“content”: “先确认本周可用时间范围”,
|
||||
“done_when”: “拿到明确的可用时间段列表”
|
||||
},
|
||||
{
|
||||
"content": "基于可用时间生成执行安排",
|
||||
"done_when": "得到一份用户可确认的安排方案"
|
||||
“content”: “基于可用时间生成执行安排”,
|
||||
“done_when”: “得到一份用户可确认的安排方案”
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user