Files
dify-plugin-sdks/python/dify_plugin/core/entities/invocation.py
T
2024-09-03 23:03:15 +08:00

28 lines
598 B
Python

from enum import Enum
class InvokeType(Enum):
Tool = 'tool'
LLM = 'llm'
TextEmbedding = 'text_embedding'
Rerank = 'rerank'
TTS = 'tts'
Speech2Text = 'speech2text'
Moderation = 'moderation'
Node = 'node'
App = 'app'
STORAGE = "storage"
@classmethod
def value_of(cls, value: str) -> 'InvokeType':
"""
Get value of given mode.
:param value: type
:return: mode
"""
for mode in cls:
if mode.value == value:
return mode
raise ValueError(f'invalid type value {value}')