MCPcopy Create free account
hub / github.com/RobotTelevision/CrowAssistant / config

Class config

CrowConfig.py:4–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2import json
3
4class config:
5
6 def __init__(self):
7 self.config = {
8 "name": "Crow",
9 "personality": "",
10 "voice": 1,
11 "url": "https://api.groq.com/openai/v1",
12 "api_key": os.environ.get("API_KEY", ""),
13 "model": "mixtral-8x7b-32768",
14 "mic":"default",
15 "speaker":"default",
16 "scale":3,
17 "port":5000,
18 "maxtoken":32000,
19 "maxmsg":100,
20 }
21 self.CONFIG_FILE = 'config.json'
22 self.load_config()
23
24 def load_config(self):
25 print("Loading Config")
26 if os.path.exists(self.CONFIG_FILE):
27 with open(self.CONFIG_FILE, 'r') as f:
28 self.config = json.load(f)
29 else:
30 print("no config")
31 #we need to launch the settings window
32
33 def save_config(self):
34 with open(self.CONFIG_FILE, 'w') as f:
35 json.dump(self.config, f, indent=2)
36
37

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected