knowledge base node checklisst

This commit is contained in:
zxhlyh 2025-06-10 10:16:13 +08:00
parent 5b4d04b348
commit 9e19ed4e67
3 changed files with 34 additions and 7 deletions

View File

@ -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: '',
}
},
}

View File

@ -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: {

View File

@ -895,6 +895,9 @@ const translation = {
chooseChunkStructure: '选择分段结构',
changeChunkStructure: '更改分段结构',
aboutRetrieval: '关于知识检索。',
chunkIsRequired: '分段结构是必需的',
indexMethodIsRequired: '索引方法是必需的',
retrievalSettingIsRequired: '检索设置是必需的',
},
},
tracing: {