-
-
+
+
diff --git a/web/app/components/workflow/nodes/knowledge-base/components/chunk-structure/index.tsx b/web/app/components/workflow/nodes/knowledge-base/components/chunk-structure/index.tsx
index 92e72c7753..6410ab706f 100644
--- a/web/app/components/workflow/nodes/knowledge-base/components/chunk-structure/index.tsx
+++ b/web/app/components/workflow/nodes/knowledge-base/components/chunk-structure/index.tsx
@@ -7,6 +7,7 @@ import OptionCard from '../option-card'
import Selector from './selector'
import { useChunkStructure } from './hooks'
import Button from '@/app/components/base/button'
+import Instruction from './instruction'
type ChunkStructureProps = {
chunkStructure?: ChunkStructureEnum
@@ -51,20 +52,23 @@ const ChunkStructure = ({
}
{
!chunkStructure && (
-
-
- {t('workflow.nodes.knowledgeBase.chooseChunkStructure')}
-
- )}
- />
+ <>
+
+
+ {t('workflow.nodes.knowledgeBase.chooseChunkStructure')}
+
+ )}
+ />
+
+ >
)
}
diff --git a/web/app/components/workflow/nodes/knowledge-base/components/chunk-structure/instruction/index.tsx b/web/app/components/workflow/nodes/knowledge-base/components/chunk-structure/instruction/index.tsx
new file mode 100644
index 0000000000..596f7993c0
--- /dev/null
+++ b/web/app/components/workflow/nodes/knowledge-base/components/chunk-structure/instruction/index.tsx
@@ -0,0 +1,47 @@
+import React from 'react'
+import { AddChunks } from '@/app/components/base/icons/src/vender/knowledge'
+import Line from './line'
+import cn from '@/utils/classnames'
+import { useTranslation } from 'react-i18next'
+import { useDocLink } from '@/context/i18n'
+
+type InstructionProps = {
+ className?: string
+}
+
+const Instruction = ({
+ className,
+}: InstructionProps) => {
+ const { t } = useTranslation()
+ const docLink = useDocLink()
+
+ return (
+
+
+
+
+ {t('workflow.nodes.knowledgeBase.chunkStructureTip.title')}
+
+
+
+
+ )
+}
+
+export default React.memo(Instruction)
diff --git a/web/app/components/workflow/nodes/knowledge-base/components/chunk-structure/instruction/line.tsx b/web/app/components/workflow/nodes/knowledge-base/components/chunk-structure/instruction/line.tsx
new file mode 100644
index 0000000000..1177130d2b
--- /dev/null
+++ b/web/app/components/workflow/nodes/knowledge-base/components/chunk-structure/instruction/line.tsx
@@ -0,0 +1,41 @@
+import React from 'react'
+
+type LineProps = {
+ type?: 'vertical' | 'horizontal'
+ className?: string
+}
+
+const Line = ({
+ type = 'vertical',
+ className,
+}: LineProps) => {
+ if (type === 'vertical') {
+ return (
+
+ )
+ }
+
+ return (
+
+ )
+}
+
+export default React.memo(Line)
diff --git a/web/app/components/workflow/nodes/knowledge-base/panel.tsx b/web/app/components/workflow/nodes/knowledge-base/panel.tsx
index c076493f81..c3dd15ed42 100644
--- a/web/app/components/workflow/nodes/knowledge-base/panel.tsx
+++ b/web/app/components/workflow/nodes/knowledge-base/panel.tsx
@@ -47,7 +47,7 @@ const Panel: FC> = ({
} = useConfig(id)
const filterVar = useCallback((variable: Var) => {
- if(!data.chunk_structure) return false
+ if (!data.chunk_structure) return false
switch (data.chunk_structure) {
case ChunkStructureEnum.general:
return variable.schemaType === 'general_structure'
@@ -55,37 +55,16 @@ const Panel: FC> = ({
return variable.schemaType === 'parent_child_structure'
case ChunkStructureEnum.question_answer:
return variable.schemaType === 'qa_structure'
+ default:
+ return false
}
- return false
}, [data.chunk_structure])
return (
-
-
-
> = ({
readonly={nodesReadOnly}
/>
-
-
- {
- data.chunk_structure && (
- <>
+ {
+ data.chunk_structure && (
+ <>
+
+
+
+
+
-
+
+
+
+ >
+ )
+ }
)
}
diff --git a/web/i18n/en-US/workflow.ts b/web/i18n/en-US/workflow.ts
index c21f0dc1b2..3585d7535b 100644
--- a/web/i18n/en-US/workflow.ts
+++ b/web/i18n/en-US/workflow.ts
@@ -934,6 +934,11 @@ const translation = {
knowledgeBase: {
chunkStructure: 'Chunk Structure',
chooseChunkStructure: 'Choose a chunk structure',
+ chunkStructureTip: {
+ title: 'Please choose a chunk structure',
+ message: 'After configuring chunk structure, this node will automatically load the remaining configurations.',
+ learnMore: 'Learn more',
+ },
changeChunkStructure: 'Change Chunk Structure',
aboutRetrieval: 'about retrieval method.',
chunkIsRequired: 'Chunk structure is required',
diff --git a/web/i18n/zh-Hans/workflow.ts b/web/i18n/zh-Hans/workflow.ts
index 498966537b..189331f44b 100644
--- a/web/i18n/zh-Hans/workflow.ts
+++ b/web/i18n/zh-Hans/workflow.ts
@@ -933,6 +933,11 @@ const translation = {
knowledgeBase: {
chunkStructure: '分段结构',
chooseChunkStructure: '选择分段结构',
+ chunkStructureTip: {
+ title: '请选择分段结构',
+ message: '配置完成分段结构后,将自动加载剩余配置。',
+ learnMore: '了解更多',
+ },
changeChunkStructure: '更改分段结构',
aboutRetrieval: '关于知识检索。',
chunkIsRequired: '分段结构是必需的',