33 lines
817 B
TypeScript
33 lines
817 B
TypeScript
import { ALL_CHAT_AVAILABLE_BLOCKS, ALL_COMPLETION_AVAILABLE_BLOCKS } from '../../constants'
|
|
import type { NodeDefault } from '../../types'
|
|
import type { AgentNodeType } from './types'
|
|
|
|
const nodeDefault: NodeDefault<AgentNodeType> = {
|
|
defaultValue: {
|
|
},
|
|
getAvailablePrevNodes(isChatMode) {
|
|
return isChatMode
|
|
? ALL_CHAT_AVAILABLE_BLOCKS
|
|
: ALL_COMPLETION_AVAILABLE_BLOCKS
|
|
},
|
|
getAvailableNextNodes(isChatMode) {
|
|
return isChatMode
|
|
? ALL_CHAT_AVAILABLE_BLOCKS
|
|
: ALL_COMPLETION_AVAILABLE_BLOCKS
|
|
},
|
|
checkValid(payload, t, moreDataForCheckValid) {
|
|
let isValid = true
|
|
let errorMessages = ''
|
|
if (payload.type) {
|
|
isValid = true
|
|
errorMessages = ''
|
|
}
|
|
return {
|
|
isValid,
|
|
errorMessage: errorMessages,
|
|
}
|
|
},
|
|
}
|
|
|
|
export default nodeDefault
|