fix(ai): 规划提示词补回用户要求——指令此前从未发送给模型

严重回归:PR #3 重写提示词时遗漏了「用户要求」段落,instruction 参数
从未写入提示词。模型只看到项目数据与规则,只能从对话历史里间接
推断用户意图,导致大量「未收到具体的中文剪辑要求」空方案。
本次把用户指令以独立段落写回提示词,并加测试断言指令必须出现。
This commit is contained in:
xhgit committed 2026-11-14 15:05:06 +08:00
1 parent d71f9e57c6
commit de12d3ba9e
2 files changed
+5

No files matched your search

+3
View File
@@ -162,6 +162,9 @@ remove {"type":"remove","id":"已有片段 ID"}。
9. 片段描述是采样观察结果,可能不完整;不确定时优先选择 score 更高的片段,并在 summary 中说明取舍。
10. 用户指令中的「这个 / 那个 / 现在 / 全部」等指代必须结合对话记录理解;只要对话记录中有可执行的要求,就不得以「未收到具体要求」为由返回空方案。只有确实无法执行时才返回空 operations。没有台词转写数据时,不要虚构字幕台词。
用户本次要求(需要执行的剪辑指令,必须据此操作):
${instruction}
${styleBlock}
${targetBlock}
${historySection}
+2
View File
@@ -39,6 +39,8 @@ test('规划提示词:按评分筛选片段、丢弃占位描述、区分新
]}});
const p={settings:{width:1920,height:1080,fps:30},media:[mk('a',90),mk('b',40)],clips:[{id:'c1',mediaId:'a',track:'video',start:0,in:0,out:5,speed:1,volume:1,motion:[{time:0,zoom:1,x:.5,y:.5}],text:'旧字幕'}]};
const fresh=plannerPrompt(p,'制作一个旅行短片',{fresh:true,target:45,style:getStyle('cinematic'),budget:9000});
assert.ok(fresh.includes('用户本次要求'));
assert.ok(fresh.includes('制作一个旅行短片'),'用户指令必须出现在提示词中');
assert.ok(fresh.includes('海滩日落'));
assert.ok(fresh.includes('城市夜景'));
assert.ok(!fresh.includes('尚未进行语义或动作识别'));