refactor(tools): fold trivial spans, async comprehension in xAI streamer
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user