feat: n to 1 retrieval legacy (#6554)

This commit is contained in:
zxhlyh
2024-07-24 12:50:48 +08:00
committed by GitHub
parent e4bb943fe5
commit 6fe9aa69cc
35 changed files with 1329 additions and 249 deletions

View File

@@ -2,7 +2,7 @@ import { BlockEnum } from '../../types'
import type { NodeDefault } from '../../types'
import type { KnowledgeRetrievalNodeType } from './types'
import { ALL_CHAT_AVAILABLE_BLOCKS, ALL_COMPLETION_AVAILABLE_BLOCKS } from '@/app/components/workflow/constants'
import { DATASET_DEFAULT } from '@/config'
import { RETRIEVE_TYPE } from '@/types/app'
const i18nPrefix = 'workflow'
@@ -10,7 +10,12 @@ const nodeDefault: NodeDefault<KnowledgeRetrievalNodeType> = {
defaultValue: {
query_variable_selector: [],
dataset_ids: [],
retrieval_mode: RETRIEVE_TYPE.oneWay,
retrieval_mode: RETRIEVE_TYPE.multiWay,
multiple_retrieval_config: {
top_k: DATASET_DEFAULT.top_k,
score_threshold: undefined,
reranking_enable: false,
},
},
getAvailablePrevNodes(isChatMode: boolean) {
const nodes = isChatMode