Spaces:
Sleeping
Sleeping
| from pathlib import Path | |
| from pydantic_settings import BaseSettings, SettingsConfigDict | |
| class Settings(BaseSettings): | |
| model_config = SettingsConfigDict( | |
| env_file=".env", | |
| env_file_encoding="utf-8", | |
| extra="ignore", | |
| ) | |
| # Upload limits | |
| max_upload_mb: int = 5 | |
| # Where uploaded files land on disk | |
| upload_dir: Path = Path("./uploads") | |
| # LLM (Phase 4) | |
| gemini_api_key: str = "" | |
| # Database (Phase 2+) | |
| database_url: str = "sqlite+aiosqlite:///./resume.db" | |
| def max_upload_bytes(self) -> int: | |
| return self.max_upload_mb * 1024 * 1024 | |
| settings = Settings() | |
| # Make sure the upload directory exists at startup | |
| settings.upload_dir.mkdir(parents=True, exist_ok=True) | |