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);
|
return message.replace(optimizedSectionRegex, optimizedPromptSection);
|
||||||
}
|
}
|
||||||
|
|
||||||
const outputSectionRegex = /(?:###\s*输出设置|【\s*输出设置\s*】)/;
|
|
||||||
if (outputSectionRegex.test(message)) {
|
|
||||||
return message.replace(outputSectionRegex, `${optimizedPromptSection}\n$&`);
|
|
||||||
}
|
|
||||||
|
|
||||||
const executionSectionRegex =
|
const executionSectionRegex =
|
||||||
/(?:###\s*执行计划|【\s*执行计划\s*】)[\s\S]*?(?=\n(?:###\s*|【\s*[^】]+\s*】)|$)/;
|
/(?:###\s*执行计划|【\s*执行计划\s*】)[\s\S]*?(?=\n(?:###\s*|【\s*[^】]+\s*】)|$)/;
|
||||||
if (executionSectionRegex.test(message)) {
|
if (executionSectionRegex.test(message)) {
|
||||||
return message.replace(executionSectionRegex, (matchedSection) => {
|
return message.replace(executionSectionRegex, optimizedPromptSection);
|
||||||
const trimmedSection = matchedSection.replace(/\s+$/, "");
|
}
|
||||||
return `${trimmedSection}\n${optimizedPromptSection}`;
|
|
||||||
});
|
const outputSectionRegex = /(?:###\s*输出设置|【\s*输出设置\s*】)/;
|
||||||
|
if (outputSectionRegex.test(message)) {
|
||||||
|
return message.replace(outputSectionRegex, `${optimizedPromptSection}\n$&`);
|
||||||
}
|
}
|
||||||
|
|
||||||
return `${message.trim()}\n\n${optimizedPromptSection}`;
|
return `${message.trim()}\n\n${optimizedPromptSection}`;
|
||||||
|
|||||||
@ -1902,10 +1902,6 @@ const optimizeNode = async (state: AutoAgentStateType) => {
|
|||||||
videoPlan,
|
videoPlan,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if (state.execution.mode === "edit_image" && !state.analysis.subIntent) {
|
|
||||||
const recommendedImageParams = heuristicImageParams(state.text, state.analysis);
|
|
||||||
return { recommendedImageParams };
|
|
||||||
}
|
|
||||||
if (!state.execution.shouldApplyImagePipeline) {
|
if (!state.execution.shouldApplyImagePipeline) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user