"""STT adapter factory for VoiceManager integration.""" from __future__ import annotations import os from fusionagi.adapters.stt_adapter import STTAdapter, StubSTTAdapter def get_stt_adapter(provider: str = "stub") -> STTAdapter: """Get an STT adapter for the given provider name. Args: provider: Provider identifier (stub, whisper, azure). Returns: Configured STTAdapter instance. """ if provider == "whisper": try: from fusionagi.adapters.stt_adapter import WhisperSTTAdapter api_key = os.environ.get("OPENAI_API_KEY", "") if api_key: return WhisperSTTAdapter(api_key=api_key) except ImportError: pass return StubSTTAdapter()