fix: ts (#4948)
This commit is contained in:
11
packages/global/core/dataset/type.d.ts
vendored
11
packages/global/core/dataset/type.d.ts
vendored
@@ -286,3 +286,14 @@ export type SearchDataResponseItemType = Omit<
|
||||
score: { type: `${SearchScoreTypeEnum}`; value: number; index: number }[];
|
||||
// score: number;
|
||||
};
|
||||
|
||||
export type DatasetCiteItemType = {
|
||||
_id: string;
|
||||
q: string;
|
||||
a?: string;
|
||||
imagePreivewUrl?: string;
|
||||
history?: DatasetDataSchemaType['history'];
|
||||
updateTime: DatasetDataSchemaType['updateTime'];
|
||||
index: DatasetDataSchemaType['chunkIndex'];
|
||||
updated?: boolean;
|
||||
};
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { getDatasetImagePreviewUrl } from '../image/utils';
|
||||
import type { QuoteDataItemType } from '../../../../../projects/app/src/service/core/chat/constants';
|
||||
import type { DatasetDataSchemaType } from '@fastgpt/global/core/dataset/type';
|
||||
import type { DatasetCiteItemType, DatasetDataSchemaType } from '@fastgpt/global/core/dataset/type';
|
||||
|
||||
export const formatDatasetDataValue = ({
|
||||
q,
|
||||
@@ -41,7 +40,7 @@ export const formatDatasetDataValue = ({
|
||||
};
|
||||
|
||||
export const getFormatDatasetCiteList = (list: DatasetDataSchemaType[]) => {
|
||||
return list.map<QuoteDataItemType>((item) => ({
|
||||
return list.map<DatasetCiteItemType>((item) => ({
|
||||
_id: item._id,
|
||||
...formatDatasetDataValue({
|
||||
teamId: item.teamId,
|
||||
|
||||
Reference in New Issue
Block a user