fix share page dataset search show (#4506)

* fix share page dataset search show

* add comment

* Fix
This commit is contained in:
heheer
2025-04-10 23:06:06 +08:00
committed by GitHub
parent ec3bcfa124
commit 4e7fa29087
4 changed files with 13 additions and 8 deletions

View File

@@ -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))

View File

@@ -61,6 +61,7 @@ export type ChatDispatchProps = {
workflowStreamResponse?: WorkflowResponseType;
workflowDispatchDeep?: number;
version?: 'v1' | 'v2';
responseDetail?: boolean;
};
export type ModuleDispatchProps<T> = ChatDispatchProps & {

View File

@@ -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, Function> = {
[FlowNodeTypeEnum.workflowStart]: dispatchWorkflowStart,
@@ -632,7 +633,8 @@ export async function dispatchWorkFlow(data: Props): Promise<DispatchFlowRespons
version === 'v2' &&
!props.isToolCall &&
!props.runningAppInfo.isChildApp &&
formatResponseData
formatResponseData &&
!(!props.responseDetail && filterModuleTypeList.includes(formatResponseData.moduleType))
) {
props.workflowStreamResponse?.({
event: SseResponseEventEnum.flowNodeResponse,