RcmEmailAutomation / app /config.py
cmoss3's picture
Error handling, confidence scoring, daily brief, deduplicate webhook notifications
0a367ef
Raw
History Blame Contribute Delete
1.45 kB
from pathlib import Path
from pydantic import HttpUrl, SecretStr
from pydantic_settings import BaseSettings, SettingsConfigDict
class Settings(BaseSettings):
azure_tenant_id: str
azure_client_id: str
azure_client_secret: SecretStr
mailbox_user: str
mail_folder_name: str
notification_url: HttpUrl
subscription_expiry_minutes: int = 4230
host: str = "0.0.0.0"
port: int = 8000
database_path: Path = Path("/data/rcmemail.db")
email_storage_path: Path = Path("/emails")
log_path: Path = Path("/logs")
dropbox_app_key: str
dropbox_app_secret: SecretStr
dropbox_refresh_token: SecretStr
dropbox_po_path: str = "/RCM Supply/Inside Sales/POs"
dropbox_invoice_path: str = "/RCM Supply/Inside Sales/Invoices"
dropbox_mtr_path: str = "/RCM Supply/MTRs"
processor_poll_interval: int = 10
score_weight_filename: float = 0.35
score_weight_ocr: float = 0.65
score_freq_multiplier: float = 0.10
score_min_threshold: float = 0.30
brief_recipients: str = ""
dev_alert_recipients: str = ""
model_config = SettingsConfigDict(env_file=".env", extra="ignore")
def brief_recipient_list(self) -> list[str]:
return [r.strip() for r in self.brief_recipients.split(",") if r.strip()]
def dev_alert_recipient_list(self) -> list[str]:
return [r.strip() for r in self.dev_alert_recipients.split(",") if r.strip()]
settings = Settings()