-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsystem_config.py
41 lines (33 loc) · 985 Bytes
/
system_config.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
"""
Set the system configuration.
"""
import yaml
class SystemConfig:
"""
Class Docstring: Describe the purpose of this class here.
"""
with open('system_config.yaml', 'r', encoding='utf-8') as file:
system_config = yaml.safe_load(file)
DEFAULT_VERSION = system_config.get('default_version', 'v1')
REQUIRED_CHATBOT_FIELDS = system_config.get('required_chatbot_fields', {})
REQUIRED_DB_FIELDS = system_config.get('required_db_fields', {})
@classmethod
def get_default_version(cls):
"""
Get the default version.
"""
return cls.DEFAULT_VERSION
@classmethod
def get_required_chatbot_fields(cls):
"""
Get the required chatbot fields.
"""
return cls.REQUIRED_CHATBOT_FIELDS
@classmethod
def get_required_db_fields(cls):
"""
Get the required database fields.
"""
return cls.REQUIRED_DB_FIELDS
if __name__ == '__main__':
pass