rag pipeline main

This commit is contained in:
zxhlyh
2025-04-25 11:32:17 +08:00
parent 97cf6b2d65
commit 076924bbd6
9 changed files with 137 additions and 36 deletions

View File

@ -1,21 +1,15 @@
import { BlockEnum } from '../../types'
import type { NodeDefault } from '../../types'
import type { DataSourceNodeType } from './types'
import { ALL_CHAT_AVAILABLE_BLOCKS, ALL_COMPLETION_AVAILABLE_BLOCKS } from '@/app/components/workflow/blocks'
import { genNodeMetaData } from '@/app/components/workflow/utils'
import { BlockEnum } from '@/app/components/workflow/types'
const nodeDefault: NodeDefault<DataSourceNodeType> = {
...genNodeMetaData({
sort: -1,
type: BlockEnum.DataSource,
}),
defaultValue: {
},
getAvailablePrevNodes(isChatMode: boolean) {
const nodes = isChatMode
? ALL_CHAT_AVAILABLE_BLOCKS
: ALL_COMPLETION_AVAILABLE_BLOCKS.filter(type => type !== BlockEnum.End)
return nodes
},
getAvailableNextNodes(isChatMode: boolean) {
const nodes = isChatMode ? ALL_CHAT_AVAILABLE_BLOCKS : ALL_COMPLETION_AVAILABLE_BLOCKS
return nodes
},
checkValid() {
return {
isValid: true,