deepgram-starters / flask-live-transcription

Starter repository for Deepgram Live Transcription in Flask
https://community.deepgram.com
MIT License
23 stars 22 forks source link

deepgram.clients.live.v1.client:exception: websockets.ConnectionClosed #7

Closed velfox closed 3 months ago

velfox commented 4 months ago

Hi, this project worked fine yesterday, but today it keeps trowing this error,

ERROR:deepgram.clients.live.v1.client:exception: websockets.ConnectionClosed

Does anyone know what the problem is and how to fix it? Thanks in advance!

Consolelog: python3 app_socketio.py INFO:werkzeug: Restarting with stat WARNING:werkzeug: Debugger is active! INFO:werkzeug: * Debugger PIN: 125-268-530 Client connected toggle_transcription {'action': 'start'} Starting Deepgram connection exception: websockets.ConnectionClosed ERROR:deepgram.clients.live.v1.client:exception: websockets.ConnectionClosed Failed to start connection

browser console log: GET http://127.0.0.1:5001/socket.io/?EIO=4&transport=polling&t=P1PntDP net::ERR_CONNECTION_REFUSED

jaindees commented 4 months ago

I am facing the same issue and the connection gets closed. Not sure what is wrong in the code. Can anyone help?

@SandraRodgers Can you help?

SandraRodgers commented 4 months ago

@jaindees and @velfox

Can you double-check the version of the deepgram-sdk that is being used in your virtual environment? I hit the same disconnect error when I didn't have the virtualenv running correctly. You can upgrade to deepgram-sdk==3.3.2 and that should work. (It works for me.) If you still have an issue, please let me know.

josebenitezg commented 3 months ago

Hi! Still having the same issue with this version of deepgram sdk

INFO:werkzeug: * Debugger PIN: 113-414-083
Client connected
toggle_transcription {'action': 'start'}
Starting Deepgram connection
ConnectionClosed in LiveClient.start: no close frame received or sent
ERROR:deepgram.clients.live.v1.client:ConnectionClosed in LiveClient.start: no close frame received or sent
Failed to start connection
SandraRodgers commented 3 months ago

@josebenitezg Are you using a virtual environment?

josebenitezg commented 3 months ago

yes, I am using virtualenv https://virtualenv.pypa.io/en/latest/

SandraRodgers commented 3 months ago

I think I know the issue. I had to update the code after I updated the SDK version. There was a breaking change. Can you pull in the most recent changes from this starter app, make sure you are on deepgram sdk version 3.3.2, and then run it again?

josebenitezg commented 3 months ago

I was able to fix the issue by re-running the socket connection, but I am not receiving any transcriptions. I confirm that the bytes are being sent to Deepgram.

Additionally, I am rewriting this for FastAPI and would love to contribute to another repository.

josebenitezg commented 3 months ago

FastAPI WSS implementation: https://github.com/josebenitezg/real-time-voice

davidvonthenen commented 3 months ago

Hi @josebenitezg

I will take over for Sandra since she will be out for a bit. Will take a look at this in a little bit

josebenitezg commented 3 months ago

Got it! Should be great to have this async wss with fastapi which is a good api/backend framework. I was able to make it work