mirror of
https://gitee.com/dify_ai/dify.git
synced 2024-12-05 20:57:46 +08:00
d109881410
Co-authored-by: -LAN- <laipz8200@outlook.com>
30 lines
766 B
Python
30 lines
766 B
Python
from enum import Enum
|
|
|
|
from .model import App, AppMode, Message
|
|
from .types import StringUUID
|
|
from .workflow import ConversationVariable, Workflow, WorkflowNodeExecutionStatus
|
|
|
|
__all__ = ["ConversationVariable", "StringUUID", "AppMode", "WorkflowNodeExecutionStatus", "Workflow", "App", "Message"]
|
|
|
|
|
|
class CreatedByRole(Enum):
|
|
"""
|
|
Enum class for createdByRole
|
|
"""
|
|
|
|
ACCOUNT = "account"
|
|
END_USER = "end_user"
|
|
|
|
@classmethod
|
|
def value_of(cls, value: str) -> "CreatedByRole":
|
|
"""
|
|
Get value of given mode.
|
|
|
|
:param value: mode value
|
|
:return: mode
|
|
"""
|
|
for role in cls:
|
|
if role.value == value:
|
|
return role
|
|
raise ValueError(f"invalid createdByRole value {value}")
|