File size: 1,090 Bytes
4b445f6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c3c0560
4b445f6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
"""Application configuration via environment variables."""

from pydantic_settings import BaseSettings


class Settings(BaseSettings):
    """All configuration loaded from environment variables."""

    # LLM APIs
    groq_api_key: str = ""
    gemini_api_key: str = ""

    # GitHub App
    github_app_id: str = ""
    github_app_private_key_path: str = "./keys/app.pem"
    github_app_private_key: str = ""  # PEM content directly (for cloud deployment)
    github_webhook_secret: str = ""

    # Database
    database_url: str = ""

    # Redis Cache
    upstash_redis_url: str = ""

    # Embedding
    embedding_model: str = "all-MiniLM-L6-v2"

    # App Config
    environment: str = "development"
    log_level: str = "INFO"
    confidence_threshold: float = 0.6
    max_repo_files_index: int = 500

    # Security
    dashboard_api_key: str = ""  # Set in production to protect dashboard API
    cors_allowed_origins: str = ""  # Comma-separated origins, e.g. "https://myapp.vercel.app"

    model_config = {"env_file": ".env", "env_file_encoding": "utf-8"}


settings = Settings()