"""Provider exports and factory for transcription adapters."""

from transcription.config import Provider
from transcription.config import Settings
from transcription.config import get_settings
from transcription.providers.base import ProviderAuthError
from transcription.providers.base import ProviderError
from transcription.providers.base import ProviderResponseError
from transcription.providers.base import TranscriptionProvider
from transcription.providers.base import TranscriptionResult
from transcription.providers.openrouter import OpenRouterTranscriptionProvider


def get_transcription_provider(*, settings: Settings | None = None) -> TranscriptionProvider:
    """Return the configured transcription provider adapter."""
    runtime_settings = settings or get_settings()
    if runtime_settings.provider == Provider.OPENROUTER:
        return OpenRouterTranscriptionProvider(settings=runtime_settings)

    raise ProviderError(f"Unsupported transcription provider: {runtime_settings.provider}")


__all__ = [
    "OpenRouterTranscriptionProvider",
    "ProviderAuthError",
    "ProviderError",
    "ProviderResponseError",
    "TranscriptionProvider",
    "TranscriptionResult",
    "get_transcription_provider",
]
