-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettings.py
More file actions
55 lines (48 loc) · 1.51 KB
/
Copy pathsettings.py
File metadata and controls
55 lines (48 loc) · 1.51 KB
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
52
53
54
55
"""Configuration settings for the MultiCoder system.
This module contains all configuration settings that can be
customized for the MultiCoder system.
"""
import os
from typing import Dict, Any
# Redis configuration
REDIS_HOST = os.environ.get("MULTICODER_REDIS_HOST", "localhost")
REDIS_PORT = int(os.environ.get("MULTICODER_REDIS_PORT", 6379))
REDIS_DB = int(os.environ.get("MULTICODER_REDIS_DB", 0))
REDIS_URL = os.environ.get(
"MULTICODER_REDIS_URL",
f"redis://{REDIS_HOST}:{REDIS_PORT}/{REDIS_DB}"
)
# Channels configuration
CHANNELS = {
"requests": "multicoder:requests",
"responses": "multicoder:responses",
"generator": "multicoder:generator",
"validator": "multicoder:validator",
}
# Logging configuration
LOG_LEVEL = os.environ.get("MULTICODER_LOG_LEVEL", "INFO")
LOG_FORMAT = "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
# Agent configuration
DEFAULT_TIMEOUT = int(os.environ.get("MULTICODER_DEFAULT_TIMEOUT", 60))
# Get full configuration dictionary
def get_config() -> Dict[str, Any]:
"""Get the complete configuration dictionary.
Returns:
Dictionary containing all configuration settings.
"""
return {
"redis": {
"host": REDIS_HOST,
"port": REDIS_PORT,
"db": REDIS_DB,
"url": REDIS_URL,
},
"channels": CHANNELS,
"logging": {
"level": LOG_LEVEL,
"format": LOG_FORMAT,
},
"timeouts": {
"default": DEFAULT_TIMEOUT,
}
}