replace execution plan with optimized prompt
This commit is contained in:
parent
45aabb9999
commit
d62de1d239
@ -296,18 +296,15 @@ function injectOptimizedPromptSection(params: {
|
||||
return message.replace(optimizedSectionRegex, optimizedPromptSection);
|
||||
}
|
||||
|
||||
const outputSectionRegex = /(?:###\s*输出设置|【\s*输出设置\s*】)/;
|
||||
if (outputSectionRegex.test(message)) {
|
||||
return message.replace(outputSectionRegex, `${optimizedPromptSection}\n$&`);
|
||||
}
|
||||
|
||||
const executionSectionRegex =
|
||||
/(?:###\s*执行计划|【\s*执行计划\s*】)[\s\S]*?(?=\n(?:###\s*|【\s*[^】]+\s*】)|$)/;
|
||||
if (executionSectionRegex.test(message)) {
|
||||
return message.replace(executionSectionRegex, (matchedSection) => {
|
||||
const trimmedSection = matchedSection.replace(/\s+$/, "");
|
||||
return `${trimmedSection}\n${optimizedPromptSection}`;
|
||||
});
|
||||
return message.replace(executionSectionRegex, optimizedPromptSection);
|
||||
}
|
||||
|
||||
const outputSectionRegex = /(?:###\s*输出设置|【\s*输出设置\s*】)/;
|
||||
if (outputSectionRegex.test(message)) {
|
||||
return message.replace(outputSectionRegex, `${optimizedPromptSection}\n$&`);
|
||||
}
|
||||
|
||||
return `${message.trim()}\n\n${optimizedPromptSection}`;
|
||||
|
||||
@ -1902,10 +1902,6 @@ const optimizeNode = async (state: AutoAgentStateType) => {
|
||||
videoPlan,
|
||||
};
|
||||
}
|
||||
if (state.execution.mode === "edit_image" && !state.analysis.subIntent) {
|
||||
const recommendedImageParams = heuristicImageParams(state.text, state.analysis);
|
||||
return { recommendedImageParams };
|
||||
}
|
||||
if (!state.execution.shouldApplyImagePipeline) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user