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:
Archer
2024-01-05 18:02:37 +08:00
committed by GitHub
parent 331d18c88f
commit 3f088bce6a
23 changed files with 242 additions and 181 deletions

View File

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