60 lines
1.9 KiB
Python
60 lines
1.9 KiB
Python
|
|
"""Application configuration via environment variables / .env file."""
|
||
|
|
|
||
|
|
from functools import lru_cache
|
||
|
|
|
||
|
|
from pydantic_settings import BaseSettings, SettingsConfigDict
|
||
|
|
|
||
|
|
|
||
|
|
class Settings(BaseSettings):
|
||
|
|
model_config = SettingsConfigDict(env_file=".env", env_prefix="GOGO_", extra="ignore")
|
||
|
|
|
||
|
|
# Core
|
||
|
|
env: str = "dev" # dev | test | prod
|
||
|
|
secret_key: str = "dev-secret-change-me"
|
||
|
|
base_url: str = "http://localhost:8000" # public URL for action links / transcripts
|
||
|
|
database_url: str = "postgresql+psycopg://gogo:gogo@localhost:5432/gogo"
|
||
|
|
|
||
|
|
# Email (SMTP). provider=console logs instead of sending.
|
||
|
|
email_provider: str = "console" # console | smtp
|
||
|
|
smtp_host: str = "localhost"
|
||
|
|
smtp_port: int = 587
|
||
|
|
smtp_user: str = ""
|
||
|
|
smtp_password: str = ""
|
||
|
|
smtp_starttls: bool = True
|
||
|
|
email_from: str = "Gogo Telefon <noreply@gogotelefon.ba>"
|
||
|
|
|
||
|
|
# SMS. provider=console logs instead of sending (GSM gateway impl in M5).
|
||
|
|
sms_provider: str = "console" # console | gsm_gateway
|
||
|
|
gsm_gateway_url: str = ""
|
||
|
|
gsm_gateway_user: str = ""
|
||
|
|
gsm_gateway_password: str = ""
|
||
|
|
|
||
|
|
# LLM
|
||
|
|
anthropic_api_key: str = ""
|
||
|
|
llm_model: str = "claude-haiku-4-5-20251001" # default; per-tenant override possible
|
||
|
|
|
||
|
|
# TTS (decided by Phase-0 PoC; both supported behind TTSProvider)
|
||
|
|
tts_provider: str = "azure" # azure | elevenlabs
|
||
|
|
azure_speech_key: str = ""
|
||
|
|
azure_speech_region: str = "westeurope"
|
||
|
|
elevenlabs_api_key: str = ""
|
||
|
|
|
||
|
|
# Google OAuth (Calendar free/busy)
|
||
|
|
google_client_id: str = ""
|
||
|
|
google_client_secret: str = ""
|
||
|
|
|
||
|
|
# Proposal engine defaults (overridable per tenant)
|
||
|
|
proposal_ttl_hours: int = 24
|
||
|
|
|
||
|
|
# Retention
|
||
|
|
audio_retention_days: int = 90
|
||
|
|
|
||
|
|
# Session cookies
|
||
|
|
session_cookie: str = "gogo_session"
|
||
|
|
session_max_age: int = 60 * 60 * 24 * 14 # 14 days
|
||
|
|
|
||
|
|
|
||
|
|
@lru_cache
|
||
|
|
def get_settings() -> Settings:
|
||
|
|
return Settings()
|