| from pydantic_settings import BaseSettings |
| from pathlib import Path |
| import os |
| from functools import lru_cache |
|
|
| |
| |
| |
| BASE_DIR = Path(__file__).resolve().parent.parent |
|
|
| |
| ENV_PATH = Path(".env") |
|
|
| SAVE_MODELS = ( |
| BASE_DIR / "models/saved/QS_XGBClassifier_SelectiveCalibratedModel_v1.0.0/" |
| ) |
|
|
|
|
| class Settings(BaseSettings): |
| """ |
| Application settings. |
| """ |
|
|
| PROJECT_NAME: str = "QS Selective Classification API" |
| VERSION: str = "1.0.0" |
| DESCRIPTION: str = "Intelligent BoQ routing and NRM hierarchy inference." |
|
|
| |
| MODEL_DIR: Path = Path(os.getenv("MODEL_DIR", SAVE_MODELS)) |
|
|
| class Config: |
| env_file = ".env" |
| case_sensitive = True |
|
|
|
|
| @lru_cache() |
| def get_settings() -> Settings: |
| return Settings() |
|
|
|
|
| settings = get_settings() |
|
|