Base classes and helpers for text‑to‑speech and speech‑to‑text providers.
# Source: https://github.com/HKUDS/DeepTutor | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
# Provided via justclaw.it.com; keep this notice with the code.
"""Base abstractions and shared helpers for voice providers."""
from __future__ import annotations
from abc import ABC, abstractmethod
import asyncio
from dataclasses import dataclass
import logging
import re
import httpx
from deeptutor.services.voice.config import (
AUTH_API_KEY_HEADER,
AUTH_TOKEN,
STTConfig,
TTSConfig,
)
from deeptutor.services.voice.speech_text import verbalize_latex_for_speech
logger = logging.getLogger(__name__)
class VoiceProviderError(RuntimeError):
"""Raised when a TTS/STT provider request fails or is misconfigured."""
def __init__(se
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key