From d257aa9335e76bb00e22189b97e538f72e981ce3 Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Wed, 2 Sep 2026 23:13:58 -0700 Subject: [PATCH] refactor(tools): fold trivial spans, async comprehension in xAI streamer --- tools/transcription_tools.py | 4 +--- tools/tts_streaming.py | 5 +---- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/tools/transcription_tools.py b/tools/transcription_tools.py index a93d28bdc1..e0292f505c 100644 --- a/tools/transcription_tools.py +++ b/tools/transcription_tools.py @@ -673,9 +673,7 @@ def transcribe_audio( shutil.rmtree(cleanup_dir, ignore_errors=True) -def transcribe_audio_local_fallback( - file_path: str, model: Optional[str] = None -) -> Dict[str, Any]: +def transcribe_audio_local_fallback(file_path: str, model: Optional[str] = None) -> Dict[str, Any]: """Try an already-installed local STT backend without changing config. Passive inbound-media recovery after the configured provider failed: never diff --git a/tools/tts_streaming.py b/tools/tts_streaming.py index 823e48aec1..a84625048f 100644 --- a/tools/tts_streaming.py +++ b/tools/tts_streaming.py @@ -335,10 +335,7 @@ class XAIStreamer(StreamingTTSProvider): return asyncio.run(self._drain_async(text)) async def _drain_async(self, text: str) -> List[bytes]: - frames: List[bytes] = [] - async for frame in self._async_frames(text): - frames.append(frame) - return frames + return [frame async for frame in self._async_frames(text)] async def _async_frames(self, text: str): import json as _json