Skip to content

Commit

Permalink
fix log warnings & cartesia end of speech (#603)
Browse files Browse the repository at this point in the history
  • Loading branch information
theomonnom authored Aug 7, 2024
1 parent 58c9e3e commit 5cfe170
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/metal-hornets-wash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"livekit-plugins-cartesia": patch
"livekit-plugins-deepgram": patch
---

fix log warnings & cartesia end of speech
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 5cfe170

Please sign in to comment.