add workflow logics

This commit is contained in:
takatost
2024-02-20 21:30:43 +08:00
parent 9ad6bd78f5
commit f067947266
44 changed files with 894 additions and 389 deletions

View File

View File

View File

View File

@ -0,0 +1,25 @@
from enum import Enum
class EndNodeOutputType(Enum):
"""
END Node Output Types.
none, plain-text, structured
"""
NONE = 'none'
PLAIN_TEXT = 'plain-text'
STRUCTURED = 'structured'
@classmethod
def value_of(cls, value: str) -> 'OutputType':
"""
Get value of given output type.
:param value: output type value
:return: output type
"""
for output_type in cls:
if output_type.value == value:
return output_type
raise ValueError(f'invalid output type value {value}')