mirror of
https://github.com/labring/FastGPT.git
synced 2025-12-26 04:32:50 +00:00
fix: improve handling of interactive node responses in workflow dispatch (#4786)
Some checks are pending
Deploy doc image to cf / deploy-production (push) Waiting to run
Deploy doc image by kubeconfig / build-fastgpt-docs-images (push) Waiting to run
Deploy doc image by kubeconfig / update-docs-image (push) Blocked by required conditions
Build FastGPT images in Personal warehouse / build-fastgpt-images (push) Waiting to run
Some checks are pending
Deploy doc image to cf / deploy-production (push) Waiting to run
Deploy doc image by kubeconfig / build-fastgpt-docs-images (push) Waiting to run
Deploy doc image by kubeconfig / update-docs-image (push) Blocked by required conditions
Build FastGPT images in Personal warehouse / build-fastgpt-images (push) Waiting to run
* fix: improve handling of interactive node responses in workflow dispatch * fix: simplify interactive response handling in dispatch functions
This commit is contained in:
parent
681ec30c38
commit
3cc6b8a17a
|
|
@ -47,6 +47,7 @@ export const dispatchRunTools = async (props: DispatchToolModuleProps): Promise<
|
|||
query,
|
||||
requestOrigin,
|
||||
chatConfig,
|
||||
lastInteractive,
|
||||
runningUserInfo,
|
||||
externalProvider,
|
||||
params: {
|
||||
|
|
@ -85,18 +86,7 @@ export const dispatchRunTools = async (props: DispatchToolModuleProps): Promise<
|
|||
});
|
||||
|
||||
// Check interactive entry
|
||||
const interactiveResponse = (() => {
|
||||
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;
|
||||
}
|
||||
}
|
||||
})();
|
||||
const interactiveResponse = lastInteractive;
|
||||
props.node.isEntry = false;
|
||||
const hasReadFilesTool = toolNodes.some(
|
||||
(item) => item.flowNodeType === FlowNodeTypeEnum.readFiles
|
||||
|
|
|
|||
Loading…
Reference in New Issue