mirror of
https://github.com/langgenius/dify.git
synced 2026-04-08 06:00:33 -04:00
21 lines
682 B
TypeScript
21 lines
682 B
TypeScript
import { AppTypeEnum } from '@/types/app'
|
|
import { BlockEnum, TRIGGER_NODE_TYPES } from '../types'
|
|
|
|
const EVALUATION_WORKFLOW_RESTRICTED_NODE_TYPES = new Set<string>([
|
|
BlockEnum.HumanInput,
|
|
...TRIGGER_NODE_TYPES,
|
|
])
|
|
|
|
export const isEvaluationWorkflow = (appType?: string) => appType === AppTypeEnum.EVALUATION
|
|
|
|
export const isEvaluationWorkflowRestrictedNodeType = (nodeType?: string) => {
|
|
if (!nodeType)
|
|
return false
|
|
|
|
return EVALUATION_WORKFLOW_RESTRICTED_NODE_TYPES.has(nodeType)
|
|
}
|
|
|
|
export const filterEvaluationWorkflowRestrictedBlockTypes = (blockTypes: BlockEnum[]) => {
|
|
return blockTypes.filter(blockType => !isEvaluationWorkflowRestrictedNodeType(blockType))
|
|
}
|