From a644153e9fabd619b37dd549a7e6f7d1f43cf989 Mon Sep 17 00:00:00 2001 From: Joel Date: Wed, 27 Aug 2025 18:16:10 +0800 Subject: [PATCH] feat: just use chunk type in knowledge base --- .../workflow/nodes/knowledge-base/panel.tsx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/web/app/components/workflow/nodes/knowledge-base/panel.tsx b/web/app/components/workflow/nodes/knowledge-base/panel.tsx index be76f9009a..c076493f81 100644 --- a/web/app/components/workflow/nodes/knowledge-base/panel.tsx +++ b/web/app/components/workflow/nodes/knowledge-base/panel.tsx @@ -6,6 +6,7 @@ import { import { useTranslation } from 'react-i18next' import type { KnowledgeBaseNodeType } from './types' import { + ChunkStructureEnum, IndexMethodEnum, } from './types' import ChunkStructure from './components/chunk-structure' @@ -46,9 +47,16 @@ const Panel: FC> = ({ } = useConfig(id) const filterVar = useCallback((variable: Var) => { - // console.log(variable.schemaType) - // return variable.schemaType === 'aaa' - return true + if(!data.chunk_structure) return false + switch (data.chunk_structure) { + 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]) return (