default.ts 597 B

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