mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-22 20:37:48 +00:00

* Training status (#4424) * dataset data training state (#4311) * dataset data training state * fix * fix ts * fix * fix api format * fix * fix * perf: count training * format * fix: dataset training state (#4417) * fix * add test * fix * fix * fix test * fix test * perf: training count * count * loading status --------- Co-authored-by: heheer <heheer@sealos.io> * doc * website sync feature (#4429) * perf: introduce BullMQ for website sync (#4403) * perf: introduce BullMQ for website sync * feat: new redis module * fix: remove graceful shutdown * perf: improve UI in dataset detail - Updated the "change" icon SVG file. - Modified i18n strings. - Added new i18n string "immediate_sync". - Improved UI in dataset detail page, including button icons and background colors. * refactor: Add chunkSettings to DatasetSchema * perf: website sync ux * env template * fix: clean up website dataset when updating chunk settings (#4420) * perf: check setting updated * perf: worker currency * feat: init script for website sync refactor (#4425) * website feature doc --------- Co-authored-by: a.e. <49438478+I-Info@users.noreply.github.com> * pro migration (#4388) (#4433) * pro migration * reuse customPdfParseType Co-authored-by: gggaaallleee <91131304+gggaaallleee@users.noreply.github.com> * perf: remove loading ui * feat: config chat file expired time * Redis cache (#4436) * perf: add Redis cache for vector counting (#4432) * feat: cache * perf: get cache key --------- Co-authored-by: a.e. <49438478+I-Info@users.noreply.github.com> * perf: mobile voice input (#4437) * update:Mobile voice interaction (#4362) * Add files via upload * Add files via upload * Update ollama.md * Update ollama.md * Add files via upload * Update useSpeech.ts * Update ChatInput.tsx * Update useSpeech.ts * Update ChatInput.tsx * Update useSpeech.ts * Update constants.ts * Add files via upload * Update ChatInput.tsx * Update useSpeech.ts * Update useSpeech.ts * Update useSpeech.ts * Update ChatInput.tsx * Add files via upload * Update common.json * Update VoiceInput.tsx * Update ChatInput.tsx * Update VoiceInput.tsx * Update useSpeech.ts * Update useSpeech.ts * Update common.json * Update common.json * Update common.json * Update VoiceInput.tsx * Update VoiceInput.tsx * Update ChatInput.tsx * Update VoiceInput.tsx * Update ChatInput.tsx * Update VoiceInput.tsx * Update ChatInput.tsx * Update useSpeech.ts * Update common.json * Update chat.json * Update common.json * Update chat.json * Update common.json * Update chat.json * Update VoiceInput.tsx * Update ChatInput.tsx * Update useSpeech.ts * Update VoiceInput.tsx * speech ui * 优化语音输入组件,调整输入框显示逻辑,修复语音输入遮罩层样式,更新画布背景透明度,增强用户交互体验。 (#4435) * perf: mobil voice input --------- Co-authored-by: dreamer6680 <1468683855@qq.com> * Test completion v2 (#4438) * add v2 completions (#4364) * add v2 completions * completion config * config version * fix * frontend * doc * fix * fix: completions v2 api --------- Co-authored-by: heheer <heheer@sealos.io> * package * Test mongo log (#4443) * feat: mongodb-log (#4426) * perf: mongo log * feat: completions stop reasoner * mongo db log --------- Co-authored-by: Finley Ge <32237950+FinleyGe@users.noreply.github.com> * update doc * Update doc * fix external var ui (#4444) * action * fix: ts (#4458) * preview doc action add docs preview permission update preview action udpate action * update doc (#4460) * update preview action * update doc * remove * update * schema * update mq export;perf: redis cache (#4465) * perf: redis cache * update mq export * perf: website sync error tip * add error worker * website sync ui (#4466) * Updated the dynamic display of the voice input pop-up (#4469) * Update VoiceInput.tsx * Update VoiceInput.tsx * Update VoiceInput.tsx * fix: voice input --------- Co-authored-by: heheer <heheer@sealos.io> Co-authored-by: a.e. <49438478+I-Info@users.noreply.github.com> Co-authored-by: gggaaallleee <91131304+gggaaallleee@users.noreply.github.com> Co-authored-by: dreamer6680 <1468683855@qq.com> Co-authored-by: Finley Ge <32237950+FinleyGe@users.noreply.github.com>
238 lines
6.8 KiB
TypeScript
238 lines
6.8 KiB
TypeScript
import { i18nT } from '../../../web/i18n/utils';
|
|
|
|
/* ------------ dataset -------------- */
|
|
export enum DatasetTypeEnum {
|
|
folder = 'folder',
|
|
dataset = 'dataset',
|
|
websiteDataset = 'websiteDataset', // depp link
|
|
externalFile = 'externalFile',
|
|
apiDataset = 'apiDataset',
|
|
feishu = 'feishu',
|
|
yuque = 'yuque'
|
|
}
|
|
export const DatasetTypeMap = {
|
|
[DatasetTypeEnum.folder]: {
|
|
icon: 'common/folderFill',
|
|
label: i18nT('dataset:folder_dataset'),
|
|
collectionLabel: i18nT('common:Folder')
|
|
},
|
|
[DatasetTypeEnum.dataset]: {
|
|
icon: 'core/dataset/commonDatasetOutline',
|
|
label: i18nT('dataset:common_dataset'),
|
|
collectionLabel: i18nT('common:common.File')
|
|
},
|
|
[DatasetTypeEnum.websiteDataset]: {
|
|
icon: 'core/dataset/websiteDatasetOutline',
|
|
label: i18nT('dataset:website_dataset'),
|
|
collectionLabel: i18nT('common:common.Website')
|
|
},
|
|
[DatasetTypeEnum.externalFile]: {
|
|
icon: 'core/dataset/externalDatasetOutline',
|
|
label: i18nT('dataset:external_file'),
|
|
collectionLabel: i18nT('common:common.File')
|
|
},
|
|
[DatasetTypeEnum.apiDataset]: {
|
|
icon: 'core/dataset/externalDatasetOutline',
|
|
label: i18nT('dataset:api_file'),
|
|
collectionLabel: i18nT('common:common.File')
|
|
},
|
|
[DatasetTypeEnum.feishu]: {
|
|
icon: 'core/dataset/feishuDatasetOutline',
|
|
label: i18nT('dataset:feishu_dataset'),
|
|
collectionLabel: i18nT('common:common.File')
|
|
},
|
|
[DatasetTypeEnum.yuque]: {
|
|
icon: 'core/dataset/yuqueDatasetOutline',
|
|
label: i18nT('dataset:yuque_dataset'),
|
|
collectionLabel: i18nT('common:common.File')
|
|
}
|
|
};
|
|
|
|
export enum DatasetStatusEnum {
|
|
active = 'active',
|
|
syncing = 'syncing',
|
|
waiting = 'waiting',
|
|
error = 'error'
|
|
}
|
|
export const DatasetStatusMap = {
|
|
[DatasetStatusEnum.active]: {
|
|
label: i18nT('common:core.dataset.status.active')
|
|
},
|
|
[DatasetStatusEnum.syncing]: {
|
|
label: i18nT('common:core.dataset.status.syncing')
|
|
},
|
|
[DatasetStatusEnum.waiting]: {
|
|
label: i18nT('common:core.dataset.status.waiting')
|
|
},
|
|
[DatasetStatusEnum.error]: {
|
|
label: i18nT('dataset:status_error')
|
|
}
|
|
};
|
|
|
|
/* ------------ collection -------------- */
|
|
export enum DatasetCollectionTypeEnum {
|
|
folder = 'folder',
|
|
virtual = 'virtual',
|
|
|
|
file = 'file',
|
|
link = 'link', // one link
|
|
externalFile = 'externalFile',
|
|
apiFile = 'apiFile'
|
|
}
|
|
export const DatasetCollectionTypeMap = {
|
|
[DatasetCollectionTypeEnum.folder]: {
|
|
name: i18nT('common:core.dataset.folder')
|
|
},
|
|
[DatasetCollectionTypeEnum.file]: {
|
|
name: i18nT('common:core.dataset.file')
|
|
},
|
|
[DatasetCollectionTypeEnum.externalFile]: {
|
|
name: i18nT('common:core.dataset.externalFile')
|
|
},
|
|
[DatasetCollectionTypeEnum.link]: {
|
|
name: i18nT('common:core.dataset.link')
|
|
},
|
|
[DatasetCollectionTypeEnum.virtual]: {
|
|
name: i18nT('common:core.dataset.Manual collection')
|
|
},
|
|
[DatasetCollectionTypeEnum.apiFile]: {
|
|
name: i18nT('common:core.dataset.apiFile')
|
|
}
|
|
};
|
|
|
|
export enum DatasetCollectionSyncResultEnum {
|
|
sameRaw = 'sameRaw',
|
|
success = 'success',
|
|
failed = 'failed'
|
|
}
|
|
export const DatasetCollectionSyncResultMap = {
|
|
[DatasetCollectionSyncResultEnum.sameRaw]: {
|
|
label: i18nT('common:core.dataset.collection.sync.result.sameRaw')
|
|
},
|
|
[DatasetCollectionSyncResultEnum.success]: {
|
|
label: i18nT('common:core.dataset.collection.sync.result.success')
|
|
},
|
|
[DatasetCollectionSyncResultEnum.failed]: {
|
|
label: i18nT('dataset:sync_collection_failed')
|
|
}
|
|
};
|
|
|
|
export enum DatasetCollectionDataProcessModeEnum {
|
|
chunk = 'chunk',
|
|
qa = 'qa',
|
|
auto = 'auto' // abandon
|
|
}
|
|
export const DatasetCollectionDataProcessModeMap = {
|
|
[DatasetCollectionDataProcessModeEnum.chunk]: {
|
|
label: i18nT('common:core.dataset.training.Chunk mode'),
|
|
tooltip: i18nT('common:core.dataset.import.Chunk Split Tip')
|
|
},
|
|
[DatasetCollectionDataProcessModeEnum.qa]: {
|
|
label: i18nT('common:core.dataset.training.QA mode'),
|
|
tooltip: i18nT('common:core.dataset.import.QA Import Tip')
|
|
},
|
|
[DatasetCollectionDataProcessModeEnum.auto]: {
|
|
label: i18nT('common:core.dataset.training.Auto mode'),
|
|
tooltip: i18nT('common:core.dataset.training.Auto mode Tip')
|
|
}
|
|
};
|
|
|
|
export enum ChunkSettingModeEnum {
|
|
auto = 'auto',
|
|
custom = 'custom'
|
|
}
|
|
|
|
export enum DataChunkSplitModeEnum {
|
|
size = 'size',
|
|
char = 'char'
|
|
}
|
|
|
|
/* ------------ data -------------- */
|
|
|
|
/* ------------ training -------------- */
|
|
export enum ImportDataSourceEnum {
|
|
fileLocal = 'fileLocal',
|
|
fileLink = 'fileLink',
|
|
fileCustom = 'fileCustom',
|
|
csvTable = 'csvTable',
|
|
externalFile = 'externalFile',
|
|
apiDataset = 'apiDataset',
|
|
reTraining = 'reTraining'
|
|
}
|
|
|
|
export enum TrainingModeEnum {
|
|
chunk = 'chunk',
|
|
qa = 'qa',
|
|
auto = 'auto',
|
|
image = 'image'
|
|
}
|
|
|
|
/* ------------ search -------------- */
|
|
export enum DatasetSearchModeEnum {
|
|
embedding = 'embedding',
|
|
fullTextRecall = 'fullTextRecall',
|
|
mixedRecall = 'mixedRecall'
|
|
}
|
|
|
|
export const DatasetSearchModeMap = {
|
|
[DatasetSearchModeEnum.embedding]: {
|
|
icon: 'core/dataset/modeEmbedding',
|
|
title: i18nT('common:core.dataset.search.mode.embedding'),
|
|
desc: i18nT('common:core.dataset.search.mode.embedding desc'),
|
|
value: DatasetSearchModeEnum.embedding
|
|
},
|
|
[DatasetSearchModeEnum.fullTextRecall]: {
|
|
icon: 'core/dataset/fullTextRecall',
|
|
title: i18nT('common:core.dataset.search.mode.fullTextRecall'),
|
|
desc: i18nT('common:core.dataset.search.mode.fullTextRecall desc'),
|
|
value: DatasetSearchModeEnum.fullTextRecall
|
|
},
|
|
[DatasetSearchModeEnum.mixedRecall]: {
|
|
icon: 'core/dataset/mixedRecall',
|
|
title: i18nT('common:core.dataset.search.mode.mixedRecall'),
|
|
desc: i18nT('common:core.dataset.search.mode.mixedRecall desc'),
|
|
value: DatasetSearchModeEnum.mixedRecall
|
|
}
|
|
};
|
|
|
|
export enum SearchScoreTypeEnum {
|
|
embedding = 'embedding',
|
|
fullText = 'fullText',
|
|
reRank = 'reRank',
|
|
rrf = 'rrf'
|
|
}
|
|
export const SearchScoreTypeMap = {
|
|
[SearchScoreTypeEnum.embedding]: {
|
|
label: i18nT('common:core.dataset.search.mode.embedding'),
|
|
desc: i18nT('common:core.dataset.search.score.embedding desc'),
|
|
showScore: true
|
|
},
|
|
[SearchScoreTypeEnum.fullText]: {
|
|
label: i18nT('common:core.dataset.search.score.fullText'),
|
|
desc: i18nT('common:core.dataset.search.score.fullText desc'),
|
|
showScore: false
|
|
},
|
|
[SearchScoreTypeEnum.reRank]: {
|
|
label: i18nT('common:core.dataset.search.score.reRank'),
|
|
desc: i18nT('common:core.dataset.search.score.reRank desc'),
|
|
showScore: true
|
|
},
|
|
[SearchScoreTypeEnum.rrf]: {
|
|
label: i18nT('common:core.dataset.search.score.rrf'),
|
|
desc: i18nT('common:core.dataset.search.score.rrf desc'),
|
|
showScore: false
|
|
}
|
|
};
|
|
|
|
export const CustomCollectionIcon = 'common/linkBlue';
|
|
export const LinkCollectionIcon = 'common/linkBlue';
|
|
|
|
/* source prefix */
|
|
export enum DatasetSourceReadTypeEnum {
|
|
fileLocal = 'fileLocal',
|
|
link = 'link',
|
|
externalFile = 'externalFile',
|
|
apiFile = 'apiFile',
|
|
reTraining = 'reTraining'
|
|
}
|