fix: loop interactive (#5714)

* fix: loop interactive

* add buffer time
This commit is contained in:
Archer
2025-09-26 16:01:20 +08:00
committed by GitHub
parent c66c2ad8f9
commit 53907af9f7
6 changed files with 29 additions and 5 deletions

View File

@@ -44,9 +44,9 @@ export const dispatchLoop = async (props: Props): Promise<Response> => {
return Promise.reject(`Input array length cannot be greater than ${maxLength}`);
}
const interactiveData =
let interactiveData =
lastInteractive?.type === 'loopInteractive' ? lastInteractive?.params : undefined;
const lastIndex = interactiveData?.currentIndex;
let lastIndex = interactiveData?.currentIndex;
const outputValueArr = interactiveData ? interactiveData.loopResult : [];
const loopResponseDetail: ChatHistoryItemResType[] = [];
@@ -127,6 +127,10 @@ export const dispatchLoop = async (props: Props): Promise<Response> => {
interactiveResponse = response.workflowInteractiveResponse;
break;
}
// Clear last interactive data, avoid being influenced by the previous round of interaction
interactiveData = undefined;
lastIndex = undefined;
}
return {