fix(ai): 新建模式下规划数据不再携带旧时间轴
实测 V2 规划失败:fresh 模式提示词要求先 remove 重建,但数据里 仍带着旧时间轴(含重复片段),模型把注意力放在旧片段的 「重复与逻辑混乱」上,最终返回空方案。 新建模式下 clips 置空、timelineDuration 归零,模型只看到素材与 新要求;应用侧仍会自动补上 remove 全部旧片段的操作。 新增测试:fresh 数据无旧片段、modify 数据保留旧片段。
This commit is contained in:
1 parent
2aa0e50f73
commit
90502dc27e
2 files changed
+10
-4
No files matched your search
@@ -50,11 +50,17 @@ test('规划提示词:按评分筛选片段、丢弃占位描述、区分新
|
||||
assert.ok(!fresh.includes('motion'));
|
||||
assert.ok(fresh.includes('先 remove 现有全部片段'));
|
||||
assert.ok(fresh.includes('45'));
|
||||
// 新建模式:数据中不带旧时间轴(避免模型被旧片段干扰)
|
||||
const freshData=JSON.parse(fresh.slice(fresh.indexOf('{',fresh.indexOf('项目数据'))));
|
||||
assert.equal(freshData.clips.length,0);
|
||||
assert.equal(freshData.timelineDuration,0);
|
||||
assert.ok(fresh.includes('score'));
|
||||
assert.ok(fresh.length<12000);
|
||||
const modify=plannerPrompt(p,'把第一个镜头缩短一点',{fresh:false,budget:9000});
|
||||
assert.ok(modify.includes('时间轴需要保留'));
|
||||
assert.ok(modify.includes('c1'));
|
||||
const modifyData=JSON.parse(modify.slice(modify.indexOf('{',modify.indexOf('项目数据'))));
|
||||
assert.equal(modifyData.clips.length,1);
|
||||
// 大数据量下仍受预算约束
|
||||
const big={settings:p.settings,media:Array.from({length:40},(_,i)=>({id:'m'+i,name:'素材'+i,type:'video',duration:300,tags:['t'],analysis:{segments:Array.from({length:10},(_,j)=>({start:j*30,end:j*30+28,description:'第'+j+'段:这是很长的一段语义描述内容用来填充上下文窗口测试预算裁剪是否生效',score:99-j}))}})),clips:Array.from({length:60},(_,i)=>({id:'c'+i,mediaId:'m0',track:'video',start:i*5,in:0,out:5,speed:1,volume:1}))};
|
||||
const small=plannerPrompt(big,'重新剪一遍',{fresh:true,budget:3800});
|
||||
|
||||
Reference in new issue
Block a user