mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 05:12:39 +00:00
fix: workflow clear repeat check run (#2646)
This commit is contained in:
@@ -303,8 +303,8 @@ export async function dispatchWorkFlow(data: Props): Promise<DispatchFlowRespons
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// 每个节点 运行/跳过 后,初始化边的状态
|
// 每个节点确定 运行/跳过 前,初始化边的状态
|
||||||
function nodeRunAfterHook(node: RuntimeNodeItemType) {
|
function nodeRunBeforeHook(node: RuntimeNodeItemType) {
|
||||||
node.isEntry = false;
|
node.isEntry = false;
|
||||||
|
|
||||||
runtimeEdges.forEach((item) => {
|
runtimeEdges.forEach((item) => {
|
||||||
@@ -331,11 +331,13 @@ export async function dispatchWorkFlow(data: Props): Promise<DispatchFlowRespons
|
|||||||
});
|
});
|
||||||
const nodeRunResult = await (() => {
|
const nodeRunResult = await (() => {
|
||||||
if (status === 'run') {
|
if (status === 'run') {
|
||||||
|
nodeRunBeforeHook(node);
|
||||||
props.maxRunTimes--;
|
props.maxRunTimes--;
|
||||||
addLog.debug(`[dispatchWorkFlow] nodeRunWithActive: ${node.name}`);
|
addLog.debug(`[dispatchWorkFlow] nodeRunWithActive: ${node.name}`);
|
||||||
return nodeRunWithActive(node);
|
return nodeRunWithActive(node);
|
||||||
}
|
}
|
||||||
if (status === 'skip' && !skippedNodeIdList.has(node.nodeId)) {
|
if (status === 'skip' && !skippedNodeIdList.has(node.nodeId)) {
|
||||||
|
nodeRunBeforeHook(node);
|
||||||
props.maxRunTimes -= 0.1;
|
props.maxRunTimes -= 0.1;
|
||||||
skippedNodeIdList.add(node.nodeId);
|
skippedNodeIdList.add(node.nodeId);
|
||||||
addLog.debug(`[dispatchWorkFlow] nodeRunWithSkip: ${node.name}`);
|
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);
|
dispatchRes[item.key] = valueTypeFormat(item.defaultValue, item.valueType);
|
||||||
});
|
});
|
||||||
|
|
||||||
nodeRunAfterHook(node);
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
node,
|
node,
|
||||||
runStatus: 'run',
|
runStatus: 'run',
|
||||||
@@ -520,7 +520,6 @@ export async function dispatchWorkFlow(data: Props): Promise<DispatchFlowRespons
|
|||||||
}> {
|
}> {
|
||||||
// Set target edges status to skipped
|
// Set target edges status to skipped
|
||||||
const targetEdges = runtimeEdges.filter((item) => item.source === node.nodeId);
|
const targetEdges = runtimeEdges.filter((item) => item.source === node.nodeId);
|
||||||
nodeRunAfterHook(node);
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
node,
|
node,
|
||||||
|
@@ -10,7 +10,12 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
|
|||||||
data: {
|
data: {
|
||||||
feConfigs: global.feConfigs,
|
feConfigs: global.feConfigs,
|
||||||
subPlans: global.subPlans,
|
subPlans: global.subPlans,
|
||||||
llmModels: global.llmModels,
|
llmModels: global.llmModels.map((model) => ({
|
||||||
|
...model,
|
||||||
|
customCQPrompt: '',
|
||||||
|
customExtractPrompt: '',
|
||||||
|
defaultSystemChatPrompt: ''
|
||||||
|
})),
|
||||||
vectorModels: global.vectorModels,
|
vectorModels: global.vectorModels,
|
||||||
reRankModels:
|
reRankModels:
|
||||||
global.reRankModels?.map((item) => ({
|
global.reRankModels?.map((item) => ({
|
||||||
|
Reference in New Issue
Block a user