-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
57 lines (48 loc) · 1.6 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
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
56
57
import os
from pathlib import Path
from dotenv import load_dotenv, find_dotenv
# Load environment variables
load_dotenv(find_dotenv())
# Base paths
ROOT_DIR = Path(__file__).parent.parent
DATA_DIR = ROOT_DIR / "data"
MODELS_DIR = ROOT_DIR / "models"
# Create directories if they don't exist
DATA_DIR.mkdir(exist_ok=True)
MODELS_DIR.mkdir(exist_ok=True)
# API Keys
GEMINI_API_KEY = os.getenv("GEMINI_API_KEY")
if not GEMINI_API_KEY:
raise ValueError("GEMINI_API_KEY not found in environment variables. Please check your .env file")
# App Configuration
APP_CONFIG = {
"name": "AI Learning Assistant",
"version": "1.0.0",
"description": "An AI-powered learning assistant for video content",
"author": "Your Name",
}
# Model Configuration
MODEL_CONFIG = {
"gemini_model": "gemini-1.5-pro",
"temperature": 0.7,
"max_output_tokens": 1024,
}
# UI Configuration
UI_CONFIG = {
"theme": "light",
"layout": "wide",
"initial_sidebar_state": "expanded",
}
# Firebase Configuration
FIREBASE_CONFIG = {
"api_key": os.getenv("FIREBASE_API_KEY"),
"auth_domain": os.getenv("FIREBASE_AUTH_DOMAIN"),
"project_id": os.getenv("FIREBASE_PROJECT_ID"),
"storage_bucket": os.getenv("FIREBASE_STORAGE_BUCKET"),
"credentials_path": ROOT_DIR / "config" / "firebase-credentials.json"
}
# Validate Firebase configuration
required_firebase_vars = ["FIREBASE_API_KEY", "FIREBASE_AUTH_DOMAIN", "FIREBASE_PROJECT_ID"]
missing_vars = [var for var in required_firebase_vars if not os.getenv(var)]
if missing_vars:
raise ValueError(f"Missing Firebase environment variables: {', '.join(missing_vars)}")