feat: add prev and next nodes

This commit is contained in:
Joel
2024-03-14 20:29:47 +08:00
parent 64e44d1709
commit ae6a558662
14 changed files with 85 additions and 47 deletions

View File

@ -1,5 +1,7 @@
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 { RETRIEVE_TYPE } from '@/types/app'
const nodeDefault: NodeDefault<KnowledgeRetrievalNodeType> = {
@ -8,11 +10,13 @@ const nodeDefault: NodeDefault<KnowledgeRetrievalNodeType> = {
dataset_ids: [],
retrieval_mode: RETRIEVE_TYPE.oneWay,
},
getAvailablePrevNodes() {
return []
getAvailablePrevNodes(isChatMode: boolean) {
const nodes = isChatMode ? ALL_CHAT_AVAILABLE_BLOCKS : ALL_COMPLETION_AVAILABLE_BLOCKS
return nodes
},
getAvailableNextNodes() {
return []
getAvailableNextNodes(isChatMode: boolean) {
const nodes = isChatMode ? ALL_CHAT_AVAILABLE_BLOCKS : ALL_COMPLETION_AVAILABLE_BLOCKS
return nodes
},
}