mirror of
https://github.com/labring/FastGPT.git
synced 2025-12-20 01:09:24 +08:00
fix share page dataset search show (#4506)
* fix share page dataset search show * add comment * Fix
This commit is contained in:
@@ -77,6 +77,13 @@ export const getHistoryPreview = (
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const filterModuleTypeList: any[] = [
|
||||||
|
FlowNodeTypeEnum.pluginModule,
|
||||||
|
FlowNodeTypeEnum.datasetSearchNode,
|
||||||
|
FlowNodeTypeEnum.tools,
|
||||||
|
FlowNodeTypeEnum.pluginOutput
|
||||||
|
];
|
||||||
|
|
||||||
export const filterPublicNodeResponseData = ({
|
export const filterPublicNodeResponseData = ({
|
||||||
flowResponses = [],
|
flowResponses = [],
|
||||||
responseDetail = false
|
responseDetail = false
|
||||||
@@ -87,12 +94,6 @@ export const filterPublicNodeResponseData = ({
|
|||||||
const filedList = responseDetail
|
const filedList = responseDetail
|
||||||
? ['quoteList', 'moduleType', 'pluginOutput', 'runningTime']
|
? ['quoteList', 'moduleType', 'pluginOutput', 'runningTime']
|
||||||
: ['moduleType', 'pluginOutput', 'runningTime'];
|
: ['moduleType', 'pluginOutput', 'runningTime'];
|
||||||
const filterModuleTypeList: any[] = [
|
|
||||||
FlowNodeTypeEnum.pluginModule,
|
|
||||||
FlowNodeTypeEnum.datasetSearchNode,
|
|
||||||
FlowNodeTypeEnum.tools,
|
|
||||||
FlowNodeTypeEnum.pluginOutput
|
|
||||||
];
|
|
||||||
|
|
||||||
return flowResponses
|
return flowResponses
|
||||||
.filter((item) => filterModuleTypeList.includes(item.moduleType))
|
.filter((item) => filterModuleTypeList.includes(item.moduleType))
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ export type ChatDispatchProps = {
|
|||||||
workflowStreamResponse?: WorkflowResponseType;
|
workflowStreamResponse?: WorkflowResponseType;
|
||||||
workflowDispatchDeep?: number;
|
workflowDispatchDeep?: number;
|
||||||
version?: 'v1' | 'v2';
|
version?: 'v1' | 'v2';
|
||||||
|
responseDetail?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type ModuleDispatchProps<T> = ChatDispatchProps & {
|
export type ModuleDispatchProps<T> = ChatDispatchProps & {
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ import { dispatchLoopStart } from './loop/runLoopStart';
|
|||||||
import { dispatchFormInput } from './interactive/formInput';
|
import { dispatchFormInput } from './interactive/formInput';
|
||||||
import { dispatchToolParams } from './agent/runTool/toolParams';
|
import { dispatchToolParams } from './agent/runTool/toolParams';
|
||||||
import { getErrText } from '@fastgpt/global/common/error/utils';
|
import { getErrText } from '@fastgpt/global/common/error/utils';
|
||||||
|
import { filterModuleTypeList } from '@fastgpt/global/core/chat/utils';
|
||||||
|
|
||||||
const callbackMap: Record<FlowNodeTypeEnum, Function> = {
|
const callbackMap: Record<FlowNodeTypeEnum, Function> = {
|
||||||
[FlowNodeTypeEnum.workflowStart]: dispatchWorkflowStart,
|
[FlowNodeTypeEnum.workflowStart]: dispatchWorkflowStart,
|
||||||
@@ -632,7 +633,8 @@ export async function dispatchWorkFlow(data: Props): Promise<DispatchFlowRespons
|
|||||||
version === 'v2' &&
|
version === 'v2' &&
|
||||||
!props.isToolCall &&
|
!props.isToolCall &&
|
||||||
!props.runningAppInfo.isChildApp &&
|
!props.runningAppInfo.isChildApp &&
|
||||||
formatResponseData
|
formatResponseData &&
|
||||||
|
!(!props.responseDetail && filterModuleTypeList.includes(formatResponseData.moduleType))
|
||||||
) {
|
) {
|
||||||
props.workflowStreamResponse?.({
|
props.workflowStreamResponse?.({
|
||||||
event: SseResponseEventEnum.flowNodeResponse,
|
event: SseResponseEventEnum.flowNodeResponse,
|
||||||
|
|||||||
@@ -296,7 +296,8 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
|
|||||||
stream,
|
stream,
|
||||||
maxRunTimes: WORKFLOW_MAX_RUN_TIMES,
|
maxRunTimes: WORKFLOW_MAX_RUN_TIMES,
|
||||||
workflowStreamResponse: workflowResponseWrite,
|
workflowStreamResponse: workflowResponseWrite,
|
||||||
version: 'v2'
|
version: 'v2',
|
||||||
|
responseDetail
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return Promise.reject('您的工作流版本过低,请重新发布一次');
|
return Promise.reject('您的工作流版本过低,请重新发布一次');
|
||||||
|
|||||||
Reference in New Issue
Block a user