mirror of
https://github.com/labring/FastGPT.git
synced 2025-12-25 20:02:47 +00:00
Some checks are pending
Build FastGPT images in Personal warehouse / build-fastgpt-images (push) Waiting to run
* perf: read rawText and chunk code * perf: read raw text * perf: read rawtext * perf: token count * log
17 lines
591 B
TypeScript
17 lines
591 B
TypeScript
import { DatasetSourceReadTypeEnum, ImportDataSourceEnum } from './constants';
|
|
|
|
export const rawTextBackupPrefix = 'index,content';
|
|
|
|
export const importType2ReadType = (type: ImportDataSourceEnum) => {
|
|
if (type === ImportDataSourceEnum.csvTable || type === ImportDataSourceEnum.fileLocal) {
|
|
return DatasetSourceReadTypeEnum.fileLocal;
|
|
}
|
|
if (type === ImportDataSourceEnum.fileLink) {
|
|
return DatasetSourceReadTypeEnum.link;
|
|
}
|
|
if (type === ImportDataSourceEnum.externalFile) {
|
|
return DatasetSourceReadTypeEnum.externalFile;
|
|
}
|
|
return DatasetSourceReadTypeEnum.link;
|
|
};
|