prof-demo / src /utils /config.py
sbicy's picture
Upload 17 files
deff797 verified
raw
history blame contribute delete
891 Bytes
import os
from pathlib import Path
from typing import Optional
class Config:
"""Application configuration."""
# Hugging Face
HUGGINGFACE_TOKEN: Optional[str] = os.getenv("HUGGINGFACE_TOKEN")
# Logging
LOG_LEVEL: str = os.getenv("LOG_LEVEL", "INFO")
ENABLE_VERBATIM_LOGS: bool = os.getenv("ENABLE_VERBATIM_LOGS", "true").lower() == "true"
# Paths
BASE_DIR = Path(__file__).parent.parent.parent
VERBATIM_LOG_PATH = BASE_DIR / os.getenv("VERBATIM_LOG_PATH", "logs/verbatim")
REDACTED_LOG_PATH = BASE_DIR / os.getenv("REDACTED_LOG_PATH", "logs/redacted")
@classmethod
def ensure_log_dirs(cls):
"""Create log directories if they don't exist."""
cls.VERBATIM_LOG_PATH.mkdir(parents=True, exist_ok=True)
cls.REDACTED_LOG_PATH.mkdir(parents=True, exist_ok=True)
config = Config()
config.ensure_log_dirs()