feat: 接入新动作 update_canvas

This commit is contained in:
2026-09-27 18:03:48 +08:00
parent 216051cd8d
commit eda1db1f88
12 changed files with 128 additions and 36 deletions
+5 -2
View File
@@ -20,7 +20,7 @@ input_context 提供当前大屏快照、用户原文及编辑上下文
"""
SIMPLE_TASK_PROMPT = """# 当前任务:直接修改
将 requirement.changes 转换成对应动作,只修改其中指定的已有组件和属性
将 requirement.changes 转换成对应动作,只修改其中指定的组件或画布属性
"""
PLAN_TASK_PROMPT = """# 当前任务:按规划生成
@@ -52,7 +52,10 @@ def build_action_prompt(
sections = [ACTION_SYSTEM_PROMPT]
if screen_plan is None:
sections.append(SIMPLE_TASK_PROMPT)
action_types = {change.operation for change in requirement.changes}
action_types = {
"update_canvas" if change.target_scope == "canvas" else change.operation
for change in requirement.changes
}
else:
sections.append(PLAN_TASK_PROMPT)
action_types = set()