mirror of
https://github.com/langgenius/dify.git
synced 2025-12-27 10:02:25 +00: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,
|
||||
},
|
||||
},
|
||||
checkValid(payload) {
|
||||
const { chunk_structure } = payload
|
||||
let errorMessage = ''
|
||||
checkValid(payload, t) {
|
||||
const {
|
||||
chunk_structure,
|
||||
indexing_technique,
|
||||
retrieval_model,
|
||||
} = payload
|
||||
|
||||
if (!chunk_structure)
|
||||
errorMessage = 'Chunk structure is required.'
|
||||
if (!chunk_structure) {
|
||||
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 {
|
||||
isValid: !errorMessage,
|
||||
errorMessage,
|
||||
isValid: true,
|
||||
errorMessage: '',
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
@ -894,6 +894,9 @@ const translation = {
|
||||
chooseChunkStructure: 'Choose a chunk structure',
|
||||
changeChunkStructure: 'Change Chunk Structure',
|
||||
aboutRetrieval: 'about retrieval method.',
|
||||
chunkIsRequired: 'Chunk structure is required',
|
||||
indexMethodIsRequired: 'Index method is required',
|
||||
retrievalSettingIsRequired: 'Retrieval setting is required',
|
||||
},
|
||||
},
|
||||
tracing: {
|
||||
|
||||
@ -895,6 +895,9 @@ const translation = {
|
||||
chooseChunkStructure: '选择分段结构',
|
||||
changeChunkStructure: '更改分段结构',
|
||||
aboutRetrieval: '关于知识检索。',
|
||||
chunkIsRequired: '分段结构是必需的',
|
||||
indexMethodIsRequired: '索引方法是必需的',
|
||||
retrievalSettingIsRequired: '检索设置是必需的',
|
||||
},
|
||||
},
|
||||
tracing: {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user