feat:优化意图识别
This commit is contained in:
@@ -37,6 +37,15 @@ layout 表示最终布局,依据当前快照计算位移和尺寸
|
||||
design 表示属性设计要求,转换为 props/style 更新;只有布局要求时不修改属性
|
||||
"""
|
||||
|
||||
REPLACE_PLAN_PROMPT = """## 更换组件类型
|
||||
每个 replace 规划生成一个 add:plan_id 用该规划编号,node.id 沿用原组件的 target_id,component_key 选择 component_type 对应的物料
|
||||
系统会在它之前删除原组件并保持原位置和尺寸,不要为它生成 delete、move 或 resize
|
||||
把原组件快照中的展示数据迁移到新物料的配置结构;原标题只是旧类型名称(如“折线图”)时改为新类型名称(如“饼图”),不用物料示例标题,用户自定义的标题保留:保留原数据的维度和数值,按新物料默认配置的写法改写字段映射,
|
||||
例如原 encode 的 x/y 改为新图表需要的名称和数值映射;原类型特有而新物料不用的配置(如坐标轴)不要带过去
|
||||
series 等数组会整体替换,提供时以物料默认配置中的对应项为基础补全
|
||||
原数据无法对应到新类型时,不提供数据相关字段,沿用物料示例数据
|
||||
"""
|
||||
|
||||
REPAIR_TASK_PROMPT = """# 当前阶段:修正重试
|
||||
结合 previous_actions、validation_errors 和 repair_plan,修正并重新生成完整动作列表
|
||||
仍从 input_context.screen 原始快照开始,不在失败动作或部分成功结果上追加执行
|
||||
@@ -68,6 +77,9 @@ def build_action_prompt(
|
||||
action_types.add("update_canvas")
|
||||
if any(item.disposition == "add" for item in screen_plan.components):
|
||||
action_types.add("add")
|
||||
if any(item.disposition == "replace" for item in screen_plan.components):
|
||||
sections.append(REPLACE_PLAN_PROMPT)
|
||||
action_types.add("add")
|
||||
if any(item.disposition == "remove" for item in screen_plan.components):
|
||||
action_types.add("delete")
|
||||
modifications = [
|
||||
|
||||
Reference in New Issue
Block a user