fix: workflow clear repeat check run (#2646)

This commit is contained in:
Archer
2024-09-09 14:14:32 +08:00
committed by GitHub
parent a1ae08f62b
commit 3ea185315d
2 changed files with 10 additions and 6 deletions

View File

@@ -303,8 +303,8 @@ export async function dispatchWorkFlow(data: Props): Promise<DispatchFlowRespons
};
}
// 每个节点 运行/跳过 ,初始化边的状态
function nodeRunAfterHook(node: RuntimeNodeItemType) {
// 每个节点确定 运行/跳过 ,初始化边的状态
function nodeRunBeforeHook(node: RuntimeNodeItemType) {
node.isEntry = false;
runtimeEdges.forEach((item) => {
@@ -331,11 +331,13 @@ export async function dispatchWorkFlow(data: Props): Promise<DispatchFlowRespons
});
const nodeRunResult = await (() => {
if (status === 'run') {
nodeRunBeforeHook(node);
props.maxRunTimes--;
addLog.debug(`[dispatchWorkFlow] nodeRunWithActive: ${node.name}`);
return nodeRunWithActive(node);
}
if (status === 'skip' && !skippedNodeIdList.has(node.nodeId)) {
nodeRunBeforeHook(node);
props.maxRunTimes -= 0.1;
skippedNodeIdList.add(node.nodeId);
addLog.debug(`[dispatchWorkFlow] nodeRunWithSkip: ${node.name}`);
@@ -502,8 +504,6 @@ export async function dispatchWorkFlow(data: Props): Promise<DispatchFlowRespons
dispatchRes[item.key] = valueTypeFormat(item.defaultValue, item.valueType);
});
nodeRunAfterHook(node);
return {
node,
runStatus: 'run',
@@ -520,7 +520,6 @@ export async function dispatchWorkFlow(data: Props): Promise<DispatchFlowRespons
}> {
// Set target edges status to skipped
const targetEdges = runtimeEdges.filter((item) => item.source === node.nodeId);
nodeRunAfterHook(node);
return {
node,

View File

@@ -10,7 +10,12 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
data: {
feConfigs: global.feConfigs,
subPlans: global.subPlans,
llmModels: global.llmModels,
llmModels: global.llmModels.map((model) => ({
...model,
customCQPrompt: '',
customExtractPrompt: '',
defaultSystemChatPrompt: ''
})),
vectorModels: global.vectorModels,
reRankModels:
global.reRankModels?.map((item) => ({