From e7c6a12f9b7e85d102d99b3a8265f7b93c9debd3 Mon Sep 17 00:00:00 2001 From: Neil Dwyer Date: Tue, 6 Feb 2024 17:18:48 -0800 Subject: [PATCH] Kitt to handle empty deepgram text + elevenlabs bug fix (#155) hotfix --- examples/kitt/kitt.py | 2 ++ .../livekit/plugins/elevenlabs/tts.py | 2 +- .../livekit/plugins/elevenlabs/version.py | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/kitt/kitt.py b/examples/kitt/kitt.py index 08707a9a4..c3523c536 100644 --- a/examples/kitt/kitt.py +++ b/examples/kitt/kitt.py @@ -130,6 +130,8 @@ async def process_track(self, track: rtc.Track): async def process_stt_stream(self, stream): buffered_text = "" async for event in stream: + if event.alternatives[0].text == "": + continue if event.is_final: buffered_text = " ".join([buffered_text, event.alternatives[0].text]) diff --git a/livekit-plugins/livekit-plugins-elevenlabs/livekit/plugins/elevenlabs/tts.py b/livekit-plugins/livekit-plugins-elevenlabs/livekit/plugins/elevenlabs/tts.py index 1f17c6093..8da8037bc 100644 --- a/livekit-plugins/livekit-plugins-elevenlabs/livekit/plugins/elevenlabs/tts.py +++ b/livekit-plugins/livekit-plugins-elevenlabs/livekit/plugins/elevenlabs/tts.py @@ -196,7 +196,7 @@ async def _run(self, max_retry: int) -> None: started = False while not ws.closed: text = None - if retry_text_queue.empty(): + if not retry_text_queue.empty(): text = await retry_text_queue.get() retry_text_queue.task_done() else: diff --git a/livekit-plugins/livekit-plugins-elevenlabs/livekit/plugins/elevenlabs/version.py b/livekit-plugins/livekit-plugins-elevenlabs/livekit/plugins/elevenlabs/version.py index 917f44bea..621bec00d 100644 --- a/livekit-plugins/livekit-plugins-elevenlabs/livekit/plugins/elevenlabs/version.py +++ b/livekit-plugins/livekit-plugins-elevenlabs/livekit/plugins/elevenlabs/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.1.4" +__version__ = "0.1.5"