From 4e7fa29087b66f117a9e0c21db1c1358ecc6865c Mon Sep 17 00:00:00 2001 From: heheer Date: Thu, 10 Apr 2025 23:06:06 +0800 Subject: [PATCH] fix share page dataset search show (#4506) * fix share page dataset search show * add comment * Fix --- packages/global/core/chat/utils.ts | 13 +++++++------ packages/global/core/workflow/runtime/type.d.ts | 1 + packages/service/core/workflow/dispatch/index.ts | 4 +++- projects/app/src/pages/api/v2/chat/completions.ts | 3 ++- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/packages/global/core/chat/utils.ts b/packages/global/core/chat/utils.ts index 4b7eba63c..f33e00007 100644 --- a/packages/global/core/chat/utils.ts +++ b/packages/global/core/chat/utils.ts @@ -77,6 +77,13 @@ export const getHistoryPreview = ( }); }; +export const filterModuleTypeList: any[] = [ + FlowNodeTypeEnum.pluginModule, + FlowNodeTypeEnum.datasetSearchNode, + FlowNodeTypeEnum.tools, + FlowNodeTypeEnum.pluginOutput +]; + export const filterPublicNodeResponseData = ({ flowResponses = [], responseDetail = false @@ -87,12 +94,6 @@ export const filterPublicNodeResponseData = ({ const filedList = responseDetail ? ['quoteList', 'moduleType', 'pluginOutput', 'runningTime'] : ['moduleType', 'pluginOutput', 'runningTime']; - const filterModuleTypeList: any[] = [ - FlowNodeTypeEnum.pluginModule, - FlowNodeTypeEnum.datasetSearchNode, - FlowNodeTypeEnum.tools, - FlowNodeTypeEnum.pluginOutput - ]; return flowResponses .filter((item) => filterModuleTypeList.includes(item.moduleType)) diff --git a/packages/global/core/workflow/runtime/type.d.ts b/packages/global/core/workflow/runtime/type.d.ts index 80a4c0897..c750ca2cd 100644 --- a/packages/global/core/workflow/runtime/type.d.ts +++ b/packages/global/core/workflow/runtime/type.d.ts @@ -61,6 +61,7 @@ export type ChatDispatchProps = { workflowStreamResponse?: WorkflowResponseType; workflowDispatchDeep?: number; version?: 'v1' | 'v2'; + responseDetail?: boolean; }; export type ModuleDispatchProps = ChatDispatchProps & { diff --git a/packages/service/core/workflow/dispatch/index.ts b/packages/service/core/workflow/dispatch/index.ts index 1d30e8cc9..9a550b036 100644 --- a/packages/service/core/workflow/dispatch/index.ts +++ b/packages/service/core/workflow/dispatch/index.ts @@ -73,6 +73,7 @@ import { dispatchLoopStart } from './loop/runLoopStart'; import { dispatchFormInput } from './interactive/formInput'; import { dispatchToolParams } from './agent/runTool/toolParams'; import { getErrText } from '@fastgpt/global/common/error/utils'; +import { filterModuleTypeList } from '@fastgpt/global/core/chat/utils'; const callbackMap: Record = { [FlowNodeTypeEnum.workflowStart]: dispatchWorkflowStart, @@ -632,7 +633,8 @@ export async function dispatchWorkFlow(data: Props): Promise