-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
41 lines (29 loc) · 959 Bytes
/
Copy pathconfig.py
File metadata and controls
41 lines (29 loc) · 959 Bytes
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
"""Configuration objects and helpers for the FastAPI application."""
import os
from typing import Optional
from pydantic_settings import BaseSettings, SettingsConfigDict
class Settings(BaseSettings):
"""Application settings loaded from environment variables or ``.env`` files."""
# --- App Settings ---
APP_NAME: str = "Inquiro API"
ENVIRONMENT: str = "dev"
# --- Database ---
POSTGRES_USER: str
POSTGRES_PASSWORD: str
POSTGRES_DB: str
POSTGRES_HOST: str
POSTGRES_PORT: int
DATABASE_URL: str
# --- JWT / Auth ---
JWT_SECRET_KEY: str
ACCESS_TOKEN_EXPIRE_MINUTES: int = 15
REFRESH_TOKEN_EXPIRE_DAYS: int = 7
# --- OpenAI ---
OPENAI_API_KEY: Optional[str] = None
# --- Safety Canary ---
SAFETY_CANARY: str
model_config = SettingsConfigDict(
env_file=os.getenv("ENV_FILE", "dev.env"),
extra="ignore",
)
settings = Settings() # type: ignore[call-arg]