mirror of
https://github.com/langgenius/dify.git
synced 2026-05-01 14:16:40 +08:00
feat: just use chunk type in knowledge base
This commit is contained in:
parent
0316eb6064
commit
a644153e9f
@ -6,6 +6,7 @@ import {
|
|||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import type { KnowledgeBaseNodeType } from './types'
|
import type { KnowledgeBaseNodeType } from './types'
|
||||||
import {
|
import {
|
||||||
|
ChunkStructureEnum,
|
||||||
IndexMethodEnum,
|
IndexMethodEnum,
|
||||||
} from './types'
|
} from './types'
|
||||||
import ChunkStructure from './components/chunk-structure'
|
import ChunkStructure from './components/chunk-structure'
|
||||||
@ -46,9 +47,16 @@ const Panel: FC<NodePanelProps<KnowledgeBaseNodeType>> = ({
|
|||||||
} = useConfig(id)
|
} = useConfig(id)
|
||||||
|
|
||||||
const filterVar = useCallback((variable: Var) => {
|
const filterVar = useCallback((variable: Var) => {
|
||||||
// console.log(variable.schemaType)
|
if(!data.chunk_structure) return false
|
||||||
// return variable.schemaType === 'aaa'
|
switch (data.chunk_structure) {
|
||||||
return true
|
case ChunkStructureEnum.general:
|
||||||
|
return variable.schemaType === 'general_structure'
|
||||||
|
case ChunkStructureEnum.parent_child:
|
||||||
|
return variable.schemaType === 'parent_child_structure'
|
||||||
|
case ChunkStructureEnum.question_answer:
|
||||||
|
return variable.schemaType === 'qa_structure'
|
||||||
|
}
|
||||||
|
return false
|
||||||
}, [data.chunk_structure])
|
}, [data.chunk_structure])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user