File size: 2,557 Bytes
f201243
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b8b7791
f201243
 
 
 
 
 
 
 
 
 
 
505ff55
f201243
 
 
 
 
 
 
 
b8b7791
f201243
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
"""Configuration settings for the ad generator."""

from pydantic_settings import BaseSettings, SettingsConfigDict
from typing import Optional


class Settings(BaseSettings):
    """Application settings loaded from environment variables."""
    
    model_config = SettingsConfigDict(
        env_file=".env",
        env_file_encoding="utf-8",
        case_sensitive=False,
        extra="ignore",
    )
    
    # OpenAI API Key (required for copy generation)
    openai_api_key: str
    
    # Replicate API Token (required for image generation)
    replicate_api_token: str
    
    # Database (MongoDB)
    mongodb_url: Optional[str] = None
    mongodb_db_name: str = "psyadgenesis"
    
    # R2 Storage (Cloudflare R2)
    r2_endpoint: Optional[str] = None
    r2_bucket_name: Optional[str] = None
    r2_access_key: Optional[str] = None
    r2_secret_key: Optional[str] = None
    r2_public_domain: Optional[str] = None  # Optional: Custom domain for public URLs (e.g., "cdn.example.com")
    
    # LLM Settings
    llm_model: str = "gpt-4o-mini"  # Cost-effective model
    llm_temperature: float = 0.95  # High for variety
    use_ai_generated_hooks: bool = False  # Set True to generate framework hook examples with AI; False = use static from frameworks.py
    
    # Vision API Settings
    vision_model: str = "gpt-4o"  # Vision-capable model for image analysis
    
    # Third Flow (Extensive) GPT Model Settings
    third_flow_model: str = "gpt-4o"  # Model for researcher, creative_director, designer, copywriter
    # Options: "gpt-4o", "gpt-4o-mini", "gpt-4-turbo", "gpt-4"
    
    # Image Generation Settings
    image_model: str = "z-image-turbo"  # Z-Image Turbo - fast and high quality
    # Alternative models: "nano-banana", "nano-banana-pro", "imagen-4-ultra", "recraft-v3", "ideogram-v3", "photon", "seedream-3", "gpt-image-1.5"
    image_width: int = 1024
    image_height: int = 1024
    
    # Output Settings
    output_dir: str = "assets/generated"
    
    # Production & Storage Settings
    environment: str = "development"  # "development" or "production"
    save_images_locally: bool = True  # Whether to save images locally
    local_image_retention_hours: int = 24  # Hours to keep images locally before cleanup (only in production)
    
    # Auth Settings
    jwt_secret_key: str = "your-secret-key-change-in-production"  # Change this in production!
    jwt_algorithm: str = "HS256"
    jwt_expiration_hours: int = 24
    
    # Debug
    debug: bool = False


# Global settings instance
settings = Settings()