from pydantic_settings import BaseSettings, SettingsConfigDict


class Settings(BaseSettings):
    model_config = SettingsConfigDict(extra="ignore")

    app_env: str = "dev"
    app_host: str = "0.0.0.0"
    app_port: int = 8000

    database_url: str

    admin_bootstrap_login: str = "admin"
    admin_bootstrap_password: str = "change_me_later"

    llm_manager_base_url: str
    llm_manager_api_key: str
    searxng_base_url: str

    upload_root: str = "/data/uploads"
    temp_root: str = "/data/temp"
    log_root: str = "/data/logs"

    max_image_mb: int = 10
    max_audio_mb: int = 25
    max_audio_duration_sec: int = 300
    max_message_chars: int = 16000

    tts_ttl_hours: int = 4
    temp_audio_ttl_hours: int = 24
    orphan_file_grace_hours: int = 24

    summary_trigger_message_count: int = 30
    summary_keep_recent_messages: int = 16
    summary_max_chars: int = 8000
    summary_model_alias: str = "qwen3.5-4b"


settings = Settings()
