services: async generators should yield frames

This commit is contained in:
Aleix Conchillo Flaqué
2024-10-02 11:57:08 -07:00
parent 8c01a900cd
commit 8bcb5d7fd2
10 changed files with 24 additions and 24 deletions

View File

@@ -176,8 +176,8 @@ class LmntTTSService(TTSService):
await self._connect()
if not self._started:
await self.push_frame(TTSStartedFrame())
await self.start_ttfb_metrics()
yield TTSStartedFrame()
self._started = True
try:
@@ -186,7 +186,7 @@ class LmntTTSService(TTSService):
await self.start_tts_usage_metrics(text)
except Exception as e:
logger.error(f"{self} error sending message: {e}")
await self.push_frame(TTSStoppedFrame())
yield TTSStoppedFrame()
await self._disconnect()
await self._connect()
return