Update docs and response tag in share page (#694)
* perf: chunk index show * share response * perf: vector query * web printFinger * remove log * fix: bucket name * perf: training schema * perf: sort index
This commit is contained in:
@@ -1,26 +1,23 @@
|
||||
import type { ChatHistoryItemResType } from '@fastgpt/global/core/chat/type.d';
|
||||
import { FlowNodeTypeEnum } from '@fastgpt/global/core/module/node/constant';
|
||||
|
||||
export function selectShareResponse({
|
||||
export const selectShareResponse = ({
|
||||
responseData = []
|
||||
}: {
|
||||
responseData?: ChatHistoryItemResType[];
|
||||
}) {
|
||||
const filedList = [
|
||||
'moduleType',
|
||||
'moduleName',
|
||||
'moduleLogo',
|
||||
'runningTime',
|
||||
'quoteList',
|
||||
'question'
|
||||
];
|
||||
return responseData.map((item) => {
|
||||
const obj: Record<string, any> = {};
|
||||
for (let key in item) {
|
||||
if (filedList.includes(key)) {
|
||||
// @ts-ignore
|
||||
obj[key] = item[key];
|
||||
}) => {
|
||||
const filedList = ['quoteList', 'moduleType'];
|
||||
const filterModuleTypeList: any[] = [FlowNodeTypeEnum.chatNode];
|
||||
return responseData
|
||||
.filter((item) => filterModuleTypeList.includes(item.moduleType))
|
||||
.map((item) => {
|
||||
const obj: Record<string, any> = {};
|
||||
for (let key in item) {
|
||||
if (filedList.includes(key)) {
|
||||
// @ts-ignore
|
||||
obj[key] = item[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
return obj as ChatHistoryItemResType;
|
||||
});
|
||||
}
|
||||
return obj as ChatHistoryItemResType;
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user