feat(api/workflow): Add Conversation.dialogue_count (#7275)

This commit is contained in:
-LAN-
2024-08-15 10:53:05 +08:00
committed by GitHub
parent 8f5d8397f9
commit 32dc963556
29 changed files with 205 additions and 259 deletions

View File

@@ -0,0 +1,25 @@
from enum import Enum
class SystemVariable(str, Enum):
"""
System Variables.
"""
QUERY = 'query'
FILES = 'files'
CONVERSATION_ID = 'conversation_id'
USER_ID = 'user_id'
DIALOGUE_COUNT = 'dialogue_count'
@classmethod
def value_of(cls, value: str):
"""
Get value of given system variable.
:param value: system variable value
:return: system variable
"""
for system_variable in cls:
if system_variable.value == value:
return system_variable
raise ValueError(f'invalid system variable value {value}')