diff --git a/gateway/platforms/web.py b/gateway/platforms/web.py index 55a6124dc2..9a5d39fa70 100644 --- a/gateway/platforms/web.py +++ b/gateway/platforms/web.py @@ -444,8 +444,9 @@ class WebAdapter(BasePlatformAdapter): f.write(audio_bytes) try: - from tools.transcription_tools import transcribe_audio - result = await asyncio.to_thread(transcribe_audio, tmp_path) + from tools.transcription_tools import transcribe_audio, get_stt_model_from_config + stt_model = get_stt_model_from_config() + result = await asyncio.to_thread(transcribe_audio, tmp_path, model=stt_model) if not result.get("success"): await self._send_to_session(session_id, { diff --git a/gateway/run.py b/gateway/run.py index 5ea408280b..a24efe01f0 100644 --- a/gateway/run.py +++ b/gateway/run.py @@ -3345,10 +3345,10 @@ class GatewayRunner: ) else: error = result.get("error", "unknown error") - if "OPENAI_API_KEY" in error or "VOICE_TOOLS_OPENAI_KEY" in error: + if "No STT provider" in error or "not set" in error: enriched_parts.append( "[The user sent a voice message but I can't listen " - "to it right now~ VOICE_TOOLS_OPENAI_KEY isn't set up yet " + "to it right now~ No STT provider is configured " "(';w;') Let them know!]" ) else: diff --git a/tools/transcription_tools.py b/tools/transcription_tools.py index b28891a8a2..09ffb6a7a6 100644 --- a/tools/transcription_tools.py +++ b/tools/transcription_tools.py @@ -209,7 +209,7 @@ def _transcribe_local(file_path: str, model_name: str) -> Dict[str, Any]: Path(file_path).name, model_name, info.language, info.duration, ) - return {"success": True, "transcript": transcript} + return {"success": True, "transcript": transcript, "provider": "local"} except Exception as e: logger.error("Local transcription failed: %s", e, exc_info=True)