-
Notifications
You must be signed in to change notification settings - Fork 0
/
AIChatEnum.py
51 lines (40 loc) · 1010 Bytes
/
AIChatEnum.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import datetime
from enum import Enum
from functools import total_ordering
class BaseEnum(Enum):
@classmethod
def from_string(cls, string):
return getattr(cls, string)
@classmethod
def from_value(cls, value):
for member in cls:
if member.value == value:
return member
raise ValueError('No member with value {}'.format(value))
@classmethod
def get_name_list(cls):
return [member.name for member in cls]
class AIChat(BaseEnum):
AddNewChatBotMode = 0
EditChatBotMode = 1
BasicSettingStage = 2
AdvancedSettingStage = 3
class SpeakerAPIType(BaseEnum):
NeneEmotion = 0
VitsSimpleAPI = 1
class TranslaterAPIType(BaseEnum):
Google = 0
Baidu = 1
DeepL = 2
Youdao = 3
OpenAI = 4
class HintType(BaseEnum):
Info = 0
Warning = 1
Error = 2
class AIGui(BaseEnum):
VerticalAlignment = 0
HorizontalAlignment = 1
class DataType(BaseEnum):
Config = 0
ChatBot = 1