from pydantic_settings import BaseSettings


class Settings(BaseSettings):
    """Voice agent configuration."""

    # LiveKit
    livekit_url: str = "ws://livekit-server:7880"
    livekit_api_key: str = "devkey"
    livekit_api_secret: str = "devsecret"

    # Agent Service
    agent_service_url: str = "http://agent-service:3002"

    # STT / TTS provider selection
    stt_provider: str = "local"  # "local" or "openai"
    tts_provider: str = "local"  # "local" or "openai"

    # Local STT (faster-whisper)
    whisper_model: str = "base"
    whisper_language: str = "zh"

    # Local TTS (Kokoro-82M)
    kokoro_voice: str = "zf_xiaoxiao"

    # OpenAI (fallback)
    openai_api_key: str = ""
    openai_base_url: str = ""
    openai_stt_model: str = "gpt-4o-transcribe"
    openai_tts_model: str = "gpt-4o-mini-tts"
    openai_tts_voice: str = "coral"

    # Device
    device: str = "cpu"  # "cpu" or "cuda"

    class Config:
        env_file = ".env"


settings = Settings()
