mirror of
https://github.com/langgenius/dify.git
synced 2026-04-29 04:26:30 +08:00
knowledge base node checklisst
This commit is contained in:
parent
5b4d04b348
commit
9e19ed4e67
@ -18,16 +18,37 @@ const nodeDefault: NodeDefault<KnowledgeBaseNodeType> = {
|
|||||||
score_threshold: 0.5,
|
score_threshold: 0.5,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
checkValid(payload) {
|
checkValid(payload, t) {
|
||||||
const { chunk_structure } = payload
|
const {
|
||||||
let errorMessage = ''
|
chunk_structure,
|
||||||
|
indexing_technique,
|
||||||
|
retrieval_model,
|
||||||
|
} = payload
|
||||||
|
|
||||||
if (!chunk_structure)
|
if (!chunk_structure) {
|
||||||
errorMessage = 'Chunk structure is required.'
|
return {
|
||||||
|
isValid: false,
|
||||||
|
errorMessage: t('workflow.nodes.knowledgeBase.chunkIsRequired'),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!indexing_technique) {
|
||||||
|
return {
|
||||||
|
isValid: false,
|
||||||
|
errorMessage: t('workflow.nodes.knowledgeBase.indexMethodIsRequired'),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!retrieval_model || !retrieval_model.search_method) {
|
||||||
|
return {
|
||||||
|
isValid: false,
|
||||||
|
errorMessage: t('workflow.nodes.knowledgeBase.retrievalSettingIsRequired'),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
isValid: !errorMessage,
|
isValid: true,
|
||||||
errorMessage,
|
errorMessage: '',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@ -894,6 +894,9 @@ const translation = {
|
|||||||
chooseChunkStructure: 'Choose a chunk structure',
|
chooseChunkStructure: 'Choose a chunk structure',
|
||||||
changeChunkStructure: 'Change Chunk Structure',
|
changeChunkStructure: 'Change Chunk Structure',
|
||||||
aboutRetrieval: 'about retrieval method.',
|
aboutRetrieval: 'about retrieval method.',
|
||||||
|
chunkIsRequired: 'Chunk structure is required',
|
||||||
|
indexMethodIsRequired: 'Index method is required',
|
||||||
|
retrievalSettingIsRequired: 'Retrieval setting is required',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
tracing: {
|
tracing: {
|
||||||
|
|||||||
@ -895,6 +895,9 @@ const translation = {
|
|||||||
chooseChunkStructure: '选择分段结构',
|
chooseChunkStructure: '选择分段结构',
|
||||||
changeChunkStructure: '更改分段结构',
|
changeChunkStructure: '更改分段结构',
|
||||||
aboutRetrieval: '关于知识检索。',
|
aboutRetrieval: '关于知识检索。',
|
||||||
|
chunkIsRequired: '分段结构是必需的',
|
||||||
|
indexMethodIsRequired: '索引方法是必需的',
|
||||||
|
retrievalSettingIsRequired: '检索设置是必需的',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
tracing: {
|
tracing: {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user