entri-proctor-api / settings.py
DhyandevP's picture
Update proctoring API without hardcoded secrets
1adec4d
Raw History Blame Contribute Delete
814 Bytes
from functools import lru_cache
from typing import List
from pydantic_settings import BaseSettings, SettingsConfigDict
class Settings(BaseSettings):
# API security (loaded from environment variable API_KEY or .env)
api_key: str = ""
api_base_url: str = "https://dhyandevp-entri-proctor-api.hf.space"
# Server configs
api_host: str = "0.0.0.0"
api_port: int = 8000
allowed_origins: List[str] = ["*"]
max_upload_bytes: int = 5 * 1024 * 1024 # 5MB upload limit
# Inference workers
ai_thread_workers: int = 2
api_workers: int = 1
api_reload: bool = False
model_config = SettingsConfigDict(
env_file=(".env", "../.env"),
env_file_encoding="utf-8",
extra="ignore"
)
@lru_cache
def get_settings() -> Settings:
return Settings()