mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-21 11:43:56 +00:00
fix: improve handling of interactive node responses in workflow dispatch (#4786)
* fix: improve handling of interactive node responses in workflow dispatch * fix: simplify interactive response handling in dispatch functions
This commit is contained in:
@@ -47,6 +47,7 @@ export const dispatchRunTools = async (props: DispatchToolModuleProps): Promise<
|
|||||||
query,
|
query,
|
||||||
requestOrigin,
|
requestOrigin,
|
||||||
chatConfig,
|
chatConfig,
|
||||||
|
lastInteractive,
|
||||||
runningUserInfo,
|
runningUserInfo,
|
||||||
externalProvider,
|
externalProvider,
|
||||||
params: {
|
params: {
|
||||||
@@ -85,18 +86,7 @@ export const dispatchRunTools = async (props: DispatchToolModuleProps): Promise<
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Check interactive entry
|
// Check interactive entry
|
||||||
const interactiveResponse = (() => {
|
const interactiveResponse = lastInteractive;
|
||||||
const lastHistory = chatHistories[chatHistories.length - 1];
|
|
||||||
if (isEntry && lastHistory?.obj === ChatRoleEnum.AI) {
|
|
||||||
const lastValue = lastHistory.value[lastHistory.value.length - 1];
|
|
||||||
if (
|
|
||||||
lastValue?.type === ChatItemValueTypeEnum.interactive &&
|
|
||||||
lastValue.interactive?.toolParams
|
|
||||||
) {
|
|
||||||
return lastValue.interactive;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
props.node.isEntry = false;
|
props.node.isEntry = false;
|
||||||
const hasReadFilesTool = toolNodes.some(
|
const hasReadFilesTool = toolNodes.some(
|
||||||
(item) => item.flowNodeType === FlowNodeTypeEnum.readFiles
|
(item) => item.flowNodeType === FlowNodeTypeEnum.readFiles
|
||||||
|
Reference in New Issue
Block a user