feat: just use chunk type in knowledge base

This commit is contained in:
Joel 2025-08-27 18:16:10 +08:00
parent 0316eb6064
commit a644153e9f

View File

@ -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 (