-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
24 lines (20 loc) · 1.05 KB
/
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
import json
import os
class Config:
def __init__(self):
self.load_config()
def load_config(self):
with open('config.json', 'r') as f:
config = json.load(f)
self.github_token = config.get('github_token')
if not self.github_token:
self.github_token = os.getenv('GITHUB_API_TOKEN')
if not self.github_token:
raise ValueError("GitHub token not found in config file or environment variables")
self.notification_settings = config.get('notification_settings')
self.subscriptions_file = config.get('subscriptions_file')
self.update_interval = config.get('update_interval', 24 * 60 * 60) # Default to 24 hours
self.llm_model = config.get('llm_model') or "gpt-3.5-turbo"
self.llm_api_key = os.getenv(config.get('llm_token_env_variable'))
self.llm_base_url = config.get('llm_base_url') or "https://api.openai.com"
self.llm_dry_run = config.get('llm_dry_run', True)