-
Notifications
You must be signed in to change notification settings - Fork 328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bot stops responding randomly - No frames not emitted by deepgram STT #455
Comments
Yes I am. It might be because Edit: Even after modifying
|
FWIW I'm also having experiencing trouble reproducing reliably, but I was able to see these errors in the logs when the bug resurfaced-- You can see that there is no dialogue after. I would guess it happens <10% of the time.
|
This is very similar to what I'm facing. I also think it's a Deepgram related issue, but I haven't found a way to fix it |
We'll have to reconnect if we detect a network issue. |
@nisalr @aconchillo I think I found the issue, it has to do with this snippet in
After looking at Deepgram's verbose logs I have a suspicion that the |
@richtermb thanks for the update. Any ideas on how to fix the issue? I feel it happens when the network connection with Deepgram is not great. According to the deepgram docs, the |
@nisalr unfortunately I can't say for sure that mine is the issue you're facing; in fact if's you think it's related to network connection then it's pretty much out of your control besides adding logic that attempts to reconnect on failure. I think in my case the "fix" would be to track In your situation I would modify In my case, a |
@richtermb Did some more digging, and this is exactly what's happening to me as well. Occasionally, the deepgram interim result is not followed by the final transcript with the |
hey @richtermb I think I found a solution to this. If a class DeepgramSTTServiceMod(DeepgramSTTService):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.finalize_after = 0.5
self.timer_task = None
print("Initializing timer")
self.reset_timer()
def reset_timer(self):
if self.timer_task:
self.timer_task.cancel()
self.timer_task = asyncio.create_task(self.timer_coroutine())
async def timer_coroutine(self):
await asyncio.sleep(self.finalize_after)
await self.send_finalize()
async def send_finalize(self):
await self._connection.send(json.dumps({"type": "Finalize"}))
print(f"Finalize sent due to {self.finalize_after} seconds of silence")
logger.info(f"Finalize sent due to {self.finalize_after} seconds of silence")
async def _on_message(self, *args, **kwargs):
result = kwargs["result"]
is_final = result.is_final
transcript = result.channel.alternatives[0].transcript
if len(transcript) > 0:
self.reset_timer()
if is_final:
await self.queue_frame(TranscriptionFrame(transcript, "", time_now_iso8601()))
else:
await self.queue_frame(InterimTranscriptionFrame(transcript, "", time_now_iso8601()) |
@nisalr I think for my case I'll send it on reception of a |
I'm using the Twilio bot with deepgram and playHT. Occasionally the bot suddenly stops responding because the deepgram STT doesn't emit frames to be sent to the LLM. I'm not able to reliably reproduce this and it seems somewhat random. Is anyone else facing this issue?
The text was updated successfully, but these errors were encountered: