default.ts 593 B

123456789101112131415161718192021
  1. import type { NodeDefault } from '../../types'
  2. import type { IterationStartNodeType } from './types'
  3. import { ALL_CHAT_AVAILABLE_BLOCKS, ALL_COMPLETION_AVAILABLE_BLOCKS } from '@/app/components/workflow/constants'
  4. const nodeDefault: NodeDefault<IterationStartNodeType> = {
  5. defaultValue: {},
  6. getAvailablePrevNodes() {
  7. return []
  8. },
  9. getAvailableNextNodes(isChatMode: boolean) {
  10. const nodes = isChatMode ? ALL_CHAT_AVAILABLE_BLOCKS : ALL_COMPLETION_AVAILABLE_BLOCKS
  11. return nodes
  12. },
  13. checkValid() {
  14. return {
  15. isValid: true,
  16. }
  17. },
  18. }
  19. export default nodeDefault