feat: knowledge base node

This commit is contained in:
zxhlyh
2025-05-06 17:24:30 +08:00
parent 12c060b795
commit a478d95950
20 changed files with 623 additions and 146 deletions

View File

@ -1,5 +1,11 @@
import type { NodeDefault } from '../../types'
import type { KnowledgeBaseNodeType } from './types'
import {
ChunkStructureEnum,
HybridSearchModeEnum,
IndexMethodEnum,
RetrievalSearchMethodEnum,
} from './types'
import { genNodeMetaData } from '@/app/components/workflow/utils'
import { BlockEnum } from '@/app/components/workflow/types'
@ -9,7 +15,19 @@ const metaData = genNodeMetaData({
})
const nodeDefault: NodeDefault<KnowledgeBaseNodeType> = {
metaData,
defaultValue: {},
defaultValue: {
index_chunk_variable_selector: [],
chunk_structure: ChunkStructureEnum.general,
indexing_technique: IndexMethodEnum.QUALIFIED,
keyword_number: 10,
retrieval_model: {
search_method: RetrievalSearchMethodEnum.hybrid,
top_k: 2,
score_threshold_enabled: false,
score_threshold: 0.5,
hybridSearchMode: HybridSearchModeEnum.WeightedScore,
},
},
checkValid() {
return {
isValid: true,