mirror of
https://github.com/labring/FastGPT.git
synced 2025-08-01 03:48:24 +00:00
External dataset (#1497)
* perf: read rawText and chunk code * perf: read raw text * perf: read rawtext * perf: token count * log
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import type { PreviewContextProps } from '@/pages/api/common/file/previewContent';
|
||||
import { GET, POST } from '@/web/common/api/request';
|
||||
import type { UploadImgProps } from '@fastgpt/global/common/file/api.d';
|
||||
import { AxiosProgressEvent } from 'axios';
|
||||
@@ -16,7 +17,7 @@ export const postUploadFiles = (
|
||||
}
|
||||
});
|
||||
|
||||
export const getPreviewFileContent = (data: { fileId: string; csvFormat: boolean }) =>
|
||||
export const getPreviewFileContent = (data: PreviewContextProps) =>
|
||||
POST<{
|
||||
previewContent: string;
|
||||
totalLength: number;
|
||||
|
@@ -22,7 +22,6 @@ import type {
|
||||
import type {
|
||||
GetTrainingQueueProps,
|
||||
GetTrainingQueueResponse,
|
||||
PostPreviewFilesChunksProps,
|
||||
SearchTestProps,
|
||||
SearchTestResponse
|
||||
} from '@/global/core/dataset/api.d';
|
||||
@@ -41,6 +40,10 @@ import type { DatasetCollectionsListItemType } from '@/global/core/dataset/type.
|
||||
import { PagingData } from '@/types';
|
||||
import type { getDatasetTrainingQueueResponse } from '@/pages/api/core/dataset/training/getDatasetTrainingQueue';
|
||||
import type { rebuildEmbeddingBody } from '@/pages/api/core/dataset/training/rebuildEmbedding';
|
||||
import type {
|
||||
PostPreviewFilesChunksProps,
|
||||
PreviewChunksResponse
|
||||
} from '@/pages/api/core/dataset/file/getPreviewChunks';
|
||||
|
||||
/* ======================== dataset ======================= */
|
||||
export const getDatasets = (data: { parentId?: string; type?: DatasetTypeEnum }) =>
|
||||
@@ -139,7 +142,7 @@ export const getDatasetTrainingQueue = (datasetId: string) =>
|
||||
});
|
||||
|
||||
export const getPreviewChunks = (data: PostPreviewFilesChunksProps) =>
|
||||
POST<{ q: string; a: string }[]>('/core/dataset/file/getPreviewChunks', data);
|
||||
POST<PreviewChunksResponse>('/core/dataset/file/getPreviewChunks', data);
|
||||
|
||||
/* ================== file ======================== */
|
||||
export const getFileViewUrl = (fileId: string) =>
|
||||
|
Reference in New Issue
Block a user