diff --git a/.changeset/metal-hornets-wash.md b/.changeset/metal-hornets-wash.md new file mode 100644 index 000000000..8cc4272c1 --- /dev/null +++ b/.changeset/metal-hornets-wash.md @@ -0,0 +1,6 @@ +--- +"livekit-plugins-cartesia": patch +"livekit-plugins-deepgram": patch +--- + +fix log warnings & cartesia end of speech diff --git a/livekit-plugins/livekit-plugins-cartesia/livekit/plugins/cartesia/tts.py b/livekit-plugins/livekit-plugins-cartesia/livekit/plugins/cartesia/tts.py index a40210b3b..c98de919d 100644 --- a/livekit-plugins/livekit-plugins-cartesia/livekit/plugins/cartesia/tts.py +++ b/livekit-plugins/livekit-plugins-cartesia/livekit/plugins/cartesia/tts.py @@ -195,7 +195,7 @@ def _new_segment(): end_pkt = base_pkt.copy() end_pkt["context_id"] = current_segment_id - end_pkt["transcript"] = self._buf + end_pkt["transcript"] = self._buf + " " end_pkt["continue"] = False await ws.send_str(json.dumps(end_pkt)) diff --git a/livekit-plugins/livekit-plugins-deepgram/livekit/plugins/deepgram/stt.py b/livekit-plugins/livekit-plugins-deepgram/livekit/plugins/deepgram/stt.py index 33cdecd26..5df542325 100644 --- a/livekit-plugins/livekit-plugins-deepgram/livekit/plugins/deepgram/stt.py +++ b/livekit-plugins/livekit-plugins-deepgram/livekit/plugins/deepgram/stt.py @@ -219,6 +219,9 @@ async def _run(self, max_retry: int) -> None: await self._run_ws(ws) except Exception as e: + if self._session.closed: + break + if retry_count >= max_retry: logger.exception( f"failed to connect to deepgram after {max_retry} tries"