refactor(tools): fold trivial spans, async comprehension in xAI streamer

This commit is contained in:
Teknium
2026-09-02 23:13:58 -07:00
parent 7ed48064db
commit d257aa9335
2 changed files with 2 additions and 7 deletions

View File

@@ -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

View File

@@ -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