feat: switch to high quan modal

pull/12097/head
AkaraChen 1 year ago
parent 9dce37bb24
commit f969dce345

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

@ -166,6 +166,9 @@ const translation = {
datasetSettingLink: 'Knowledge settings.', datasetSettingLink: 'Knowledge settings.',
previewChunkTip: 'Click the \'Preview Chunk\' button on the left to load the preview', previewChunkTip: 'Click the \'Preview Chunk\' button on the left to load the preview',
previewChunkCount: '{{count}} Estimated chunks', 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: { stepThree: {
creationTitle: '🎉 Knowledge created', creationTitle: '🎉 Knowledge created',

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

Loading…
Cancel
Save