File size: 747 Bytes
c8f4a46
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
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"

    @property
    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)