From 4c9bf783639a2c4ddf19e964dc83ba65f7c14841 Mon Sep 17 00:00:00 2001 From: zxhlyh Date: Wed, 4 Jun 2025 15:17:34 +0800 Subject: [PATCH] knowledge base node checklist --- .../workflow/nodes/knowledge-base/default.ts | 12 +++++++++--- .../nodes/tool/components/input-var-list.tsx | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/web/app/components/workflow/nodes/knowledge-base/default.ts b/web/app/components/workflow/nodes/knowledge-base/default.ts index 94caf73253..29d37c66d2 100644 --- a/web/app/components/workflow/nodes/knowledge-base/default.ts +++ b/web/app/components/workflow/nodes/knowledge-base/default.ts @@ -18,10 +18,16 @@ const nodeDefault: NodeDefault = { score_threshold: 0.5, }, }, - checkValid() { + checkValid(payload) { + const { chunk_structure } = payload + let errorMessage = '' + + if (!chunk_structure) + errorMessage = 'Chunk structure is required.' + return { - isValid: true, - errorMessage: '', + isValid: !errorMessage, + errorMessage, } }, } diff --git a/web/app/components/workflow/nodes/tool/components/input-var-list.tsx b/web/app/components/workflow/nodes/tool/components/input-var-list.tsx index 1a609c58f5..7f310051e2 100644 --- a/web/app/components/workflow/nodes/tool/components/input-var-list.tsx +++ b/web/app/components/workflow/nodes/tool/components/input-var-list.tsx @@ -172,7 +172,7 @@ const InputVarList: FC = ({ return (
-
+
{label[language] || label.en_US} {paramType(type)} {required && Required}