mirror of
https://github.com/langgenius/dify.git
synced 2026-05-05 09:58:04 +08:00
Refactor: Replace IndexMethodRadio with IndexMethod component, add keyword number functionality, and update related translations
This commit is contained in:
@ -9,7 +9,8 @@ import { ChunkingMode } from '@/models/datasets'
|
||||
export const useChunkStructure = () => {
|
||||
const GeneralOption: Option = {
|
||||
id: ChunkingMode.text,
|
||||
icon: <GeneralChunk className='size-[18px] text-util-colors-indigo-indigo-600' />,
|
||||
icon: <GeneralChunk className='size-[18px]' />,
|
||||
iconActiveColor: 'text-util-colors-indigo-indigo-600',
|
||||
title: 'General',
|
||||
description: 'General text chunking mode, the chunks retrieved and recalled are the same.',
|
||||
effectColor: EffectColor.indigo,
|
||||
@ -17,7 +18,8 @@ export const useChunkStructure = () => {
|
||||
}
|
||||
const ParentChildOption: Option = {
|
||||
id: ChunkingMode.parentChild,
|
||||
icon: <ParentChildChunk className='size-[18px] text-util-colors-blue-light-blue-light-500' />,
|
||||
icon: <ParentChildChunk className='size-[18px]' />,
|
||||
iconActiveColor: 'text-util-colors-blue-light-blue-light-500',
|
||||
title: 'Parent-Child',
|
||||
description: 'When using the parent-child mode, the child-chunk is used for retrieval and the parent-chunk is used for recall as context.',
|
||||
effectColor: EffectColor.blueLight,
|
||||
@ -25,7 +27,7 @@ export const useChunkStructure = () => {
|
||||
}
|
||||
const QuestionAnswerOption: Option = {
|
||||
id: ChunkingMode.qa,
|
||||
icon: <QuestionAndAnswer className='size-[18px] text-text-tertiary' />,
|
||||
icon: <QuestionAndAnswer className='size-[18px]' />,
|
||||
title: 'Q&A',
|
||||
description: 'When using structured Q&A data, you can create documents that pair questions with answers. These documents are indexed based on the question portion, allowing the system to retrieve relevant answers based on query similarity',
|
||||
}
|
||||
|
||||
@ -24,12 +24,13 @@ const ChunkStructure = ({
|
||||
key={option.id}
|
||||
id={option.id}
|
||||
icon={option.icon}
|
||||
iconActiveColor={option.iconActiveColor}
|
||||
title={option.title}
|
||||
description={option.description}
|
||||
onClick={() => {
|
||||
onChunkStructureChange(option.id)
|
||||
}}
|
||||
showHighlightBorder={chunkStructure === option.id}
|
||||
isActive={chunkStructure === option.id}
|
||||
effectColor={option.effectColor}
|
||||
showEffectColor
|
||||
className='gap-x-1.5 p-3 pr-4'
|
||||
|
||||
@ -10,6 +10,7 @@ export enum EffectColor {
|
||||
export type Option = {
|
||||
id: ChunkingMode
|
||||
icon?: React.ReactNode
|
||||
iconActiveColor?: string
|
||||
title: string
|
||||
description?: string
|
||||
effectColor?: EffectColor
|
||||
|
||||
Reference in New Issue
Block a user