feat: switch to high quan modal

This commit is contained in:
AkaraChen 2024-12-11 16:50:32 +08:00
parent 9dce37bb24
commit f969dce345
3 changed files with 18 additions and 9 deletions

View File

@ -517,14 +517,11 @@ const StepTwo = ({
}
const changeToEconomicalType = () => {
if (docForm === ChuckingMode.parentChild)
if (docForm !== ChuckingMode.text)
return
if (!hasSetIndexType) {
if (!hasSetIndexType)
setIndexType(IndexingType.ECONOMICAL)
if (docForm === ChuckingMode.qa)
handleChangeDocform(ChuckingMode.text)
}
}
useEffect(() => {
@ -842,19 +839,25 @@ const StepTwo = ({
>
<CustomDialog show={isQAConfirmDialogOpen} onClose={() => setIsQAConfirmDialogOpen(false)} className='w-[432px]'>
<header className='pt-6 mb-4'>
<h2 className='text-lg font-semibold'>Q&A Format Requires High-quality Indexing Method </h2>
<p className='font-normal text-sm mt-2'>Currently, only high-quality index method supports Q&A format chunking. Would you like to switch to high-quality mode?</p>
<h2 className='text-lg font-semibold'>
{t('datasetCreation.stepTwo.qaSwitchHighQualityTipTitle')}
</h2>
<p className='font-normal text-sm mt-2'>
{t('datasetCreation.stepTwo.qaSwitchHighQualityTipContent')}
</p>
</header>
<div className='flex gap-2 pb-6'>
<Button className='ml-auto' onClick={() => {
setIsQAConfirmDialogOpen(false)
}}>Cancel</Button>
}}>
{t('datasetCreation.stepTwo.cancel')}
</Button>
<Button variant={'primary'} onClick={() => {
setIsQAConfirmDialogOpen(false)
setIndexType(IndexingType.QUALIFIED)
setDocForm(ChuckingMode.qa)
}}>
Switch
{t('datasetCreation.stepTwo.switch')}
</Button>
</div>
</CustomDialog>

View File

@ -166,6 +166,9 @@ const translation = {
datasetSettingLink: 'Knowledge settings.',
previewChunkTip: 'Click the \'Preview Chunk\' button on the left to load the preview',
previewChunkCount: '{{count}} Estimated chunks',
switch: 'Switch',
qaSwitchHighQualityTipTitle: 'Q&A Format Requires High-quality Indexing Method',
qaSwitchHighQualityTipContent: 'Currently, only high-quality index method supports Q&A format chunking. Would you like to switch to high-quality mode?',
},
stepThree: {
creationTitle: '🎉 Knowledge created',

View File

@ -166,6 +166,9 @@ const translation = {
datasetSettingLink: '知识库设置。',
previewChunkTip: '点击左侧的“预览块”按钮来加载预览',
previewChunkCount: '{{count}} 预估块',
switch: '切换',
qaSwitchHighQualityTipTitle: 'Q&A 格式需要高质量的索引方法',
qaSwitchHighQualityTipContent: '目前,只有高质量的索引方法支持 Q&A 格式分块。您要切换到高质量模式吗?',
},
stepThree: {
creationTitle: '🎉 知识库已创建',