您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

default.ts 703B

123456789101112131415161718192021222324252627
  1. import { BlockEnum } from '../../types'
  2. import type { NodeDefault } from '../../types'
  3. import type { EndNodeType } from './types'
  4. import { ALL_CHAT_AVAILABLE_BLOCKS, ALL_COMPLETION_AVAILABLE_BLOCKS } from '@/app/components/workflow/blocks'
  5. const nodeDefault: NodeDefault<EndNodeType> = {
  6. defaultValue: {
  7. outputs: [],
  8. },
  9. getAvailablePrevNodes(isChatMode: boolean) {
  10. const nodes = isChatMode
  11. ? ALL_CHAT_AVAILABLE_BLOCKS
  12. : ALL_COMPLETION_AVAILABLE_BLOCKS.filter(type => type !== BlockEnum.End)
  13. return nodes
  14. },
  15. getAvailableNextNodes() {
  16. return []
  17. },
  18. checkValid() {
  19. return {
  20. isValid: true,
  21. errorMessage: '',
  22. }
  23. },
  24. }
  25. export default nodeDefault