Spaces:
Sleeping
Sleeping
| # config.py | |
| import os | |
| import secrets | |
| from pydantic import Field | |
| from pydantic_settings import BaseSettings, SettingsConfigDict | |
| from passlib.context import CryptContext | |
| from typing import Optional | |
| # --- Pydantic Settings (La Config Inmutable y Validada) --- | |
| class GlobalSettings(BaseSettings): | |
| """Configuración global de la aplicación.""" | |
| model_config = SettingsConfigDict(env_ignore_empty=True, extra='ignore') | |
| JWT_SECRET_KEY: str = Field(default_factory=lambda: os.environ.get("JWT_SECRET_KEY", secrets.token_hex(256))) | |
| GROQ_API_KEY: Optional[str] = os.environ.get("GROQ_API_KEY") | |
| GEMINI_API_KEY: Optional[str] = os.environ.get("GEMINI_API_KEY") | |
| DB_PATH: str = "data/omega_modular_argentina.db" | |
| TOKEN_EXPIRE_MINUTES: int = 2880 | |
| RATE_LIMIT_WINDOW: int = 45 | |
| RATE_LIMIT_REQUESTS: int = 8 | |
| AI_TIMEOUT_SECONDS: float = 8.0 | |
| SETTINGS = GlobalSettings() | |
| pwd_context = CryptContext(schemes=["argon2"], deprecated="auto") |