Merge branch 'feat/parent-child-retrieval' of github.com:langgenius/dify into feat/parent-child-retrieval

pull/12097/head
NFish 1 year ago
commit 330cfaf6d6

@ -656,7 +656,7 @@ const StepTwo = ({
/> />
<div className='flex items-center gap-1'> <div className='flex items-center gap-1'>
<label className="ml-2 system-sm-regular cursor-pointer text-text-secondary"> <label className="ml-2 system-sm-regular cursor-pointer text-text-secondary">
{t('datasetCreation.stepTwo.QALanguage')} {t('datasetCreation.stepTwo.useQALanguage')}
</label> </label>
<div className='z-50 relative'> <div className='z-50 relative'>
<LanguageSelect <LanguageSelect

@ -135,7 +135,7 @@ const ChildSegmentList: FC<IChildSegmentCardProps> = ({
</div> </div>
{isLoading ? <FullDocListSkeleton /> : null} {isLoading ? <FullDocListSkeleton /> : null}
{((isFullDocMode && !isLoading) || !collapsed) {((isFullDocMode && !isLoading) || !collapsed)
? <div className={classNames('flex items-center gap-x-0.5', isFullDocMode ? 'grow' : '')}> ? <div className={classNames('flex items-center gap-x-0.5', isFullDocMode ? 'grow mb-6' : '')}>
{isParagraphMode && ( {isParagraphMode && (
<div className='self-stretch my-0.5'> <div className='self-stretch my-0.5'>
<Divider type='vertical' className='w-[2px] mx-[7px] bg-text-accent-secondary' /> <Divider type='vertical' className='w-[2px] mx-[7px] bg-text-accent-secondary' />

@ -31,9 +31,9 @@ const ActionButtons: FC<IActionButtonsProps> = ({
}) })
useKeyPress(`${getKeyboardKeyCodeBySystem('ctrl')}.s`, (e) => { useKeyPress(`${getKeyboardKeyCodeBySystem('ctrl')}.s`, (e) => {
e.preventDefault()
if (loading) if (loading)
return return
e.preventDefault()
handleSave() handleSave()
} }
, { exactMatch: true, useCapture: true }) , { exactMatch: true, useCapture: true })

@ -538,7 +538,7 @@ const Completed: FC<ICompletedProps> = ({
{ {
isFullDocMode isFullDocMode
? <div className={cn( ? <div className={cn(
'flex flex-col grow relative overflow-x-hidden', 'flex flex-col grow overflow-x-hidden',
(isLoadingSegmentList || isLoadingChildSegmentList) ? 'overflow-y-hidden' : 'overflow-y-auto', (isLoadingSegmentList || isLoadingChildSegmentList) ? 'overflow-y-hidden' : 'overflow-y-auto',
)}> )}>
<SegmentCard <SegmentCard

@ -19,11 +19,11 @@ const ChildChunks: FC<Props> = ({
<div <div
className={!isShowAll ? 'line-clamp-2' : ''} className={!isShowAll ? 'line-clamp-2' : ''}
> >
<div className='inline-flex items-center relative top-[-3px]'> <div className='inline-flex items-center relative top-[-2px]'>
<div className='flex items-center h-[24px] bg-state-accent-solid system-2xs-semibold-uppercase text-text-primary-on-surface px-1'>C-{position}</div> <div className='flex items-center h-[20.5px] bg-state-accent-solid system-2xs-semibold-uppercase text-text-primary-on-surface px-1'>C-{position}</div>
<Score value={score} besideChunkName /> <Score value={score} besideChunkName />
</div> </div>
<SliceContent className='bg-state-accent-hover group-hover:bg-state-accent-hover text-text-secondary font-normal'>{content}</SliceContent> <SliceContent className='py-0.5 bg-state-accent-hover group-hover:bg-state-accent-hover text-sm text-text-secondary font-normal'>{content}</SliceContent>
</div> </div>
) )
} }

@ -38,8 +38,8 @@ const ChunkDetailModal: FC<Props> = ({
onClose={onHide} onClose={onHide}
className={cn(isParentChildRetrieval ? '!min-w-[1200px]' : '!min-w-[720px]')} className={cn(isParentChildRetrieval ? '!min-w-[1200px]' : '!min-w-[720px]')}
> >
<div className='mt-4 flex pb-6'> <div className='mt-4 flex'>
<div> <div className='w-full'>
{/* Meta info */} {/* Meta info */}
<div className='flex justify-between items-center'> <div className='flex justify-between items-center'>
<div className='grow flex items-center space-x-2'> <div className='grow flex items-center space-x-2'>

@ -13,7 +13,7 @@ const Score: FC<Props> = ({
besideChunkName, besideChunkName,
}) => { }) => {
return ( return (
<div className={cn('relative items-center px-[5px] border border-components-progress-bar-border overflow-hidden', besideChunkName ? 'border-l-0 h-[25px]' : 'h-[20px] rounded-md')}> <div className={cn('relative items-center px-[5px] border border-components-progress-bar-border overflow-hidden', besideChunkName ? 'border-l-0 h-[20.5px]' : 'h-[20px] rounded-md')}>
<div className={cn('absolute top-0 left-0 h-full bg-util-colors-blue-brand-blue-brand-100 border-r-[1.5px] border-components-progress-brand-progress', value === 1 && 'border-r-0')} style={{ width: `${value * 100}%` }} /> <div className={cn('absolute top-0 left-0 h-full bg-util-colors-blue-brand-blue-brand-100 border-r-[1.5px] border-components-progress-brand-progress', value === 1 && 'border-r-0')} style={{ width: `${value * 100}%` }} />
<div className={cn('relative flex items-center h-full space-x-0.5 text-util-colors-blue-brand-blue-brand-700')}> <div className={cn('relative flex items-center h-full space-x-0.5 text-util-colors-blue-brand-blue-brand-700')}>
<div className='system-2xs-medium-uppercase'>score</div> <div className='system-2xs-medium-uppercase'>score</div>

@ -136,6 +136,7 @@ const translation = {
QATitle: 'Segmenting in Question & Answer format', QATitle: 'Segmenting in Question & Answer format',
QATip: 'Enable this option will consume more tokens', QATip: 'Enable this option will consume more tokens',
QALanguage: 'Segment using', QALanguage: 'Segment using',
useQALanguage: 'Chunk using Q&A format in',
estimateCost: 'Estimation', estimateCost: 'Estimation',
estimateSegment: 'Estimated chunks', estimateSegment: 'Estimated chunks',
segmentCount: 'chunks', segmentCount: 'chunks',

@ -136,6 +136,7 @@ const translation = {
QATitle: '采用 Q&A 分段模式', QATitle: '采用 Q&A 分段模式',
QATip: '开启后将会消耗额外的 token', QATip: '开启后将会消耗额外的 token',
QALanguage: '分段使用', QALanguage: '分段使用',
useQALanguage: '使用 Q&A 分段,语言',
estimateCost: '执行嵌入预估消耗', estimateCost: '执行嵌入预估消耗',
estimateSegment: '预估分段数', estimateSegment: '预估分段数',
segmentCount: '段', segmentCount: '段',

Loading…
Cancel
Save