Open roerohan opened 7 months ago
Hi @roerohan The Live client is in the process of getting a major overhaul. Will ping the community to take a look when the PR becomes available.
Alright!
I also wanted to bring to your notice that there's no way to handle this error currently since the async task created in the following code snippet isn't returned outside the SDK, and there's no way to catch the exception since I don't have access to this task
For now, the only way I found to fix it was a hacky workaround, by using the _socket
object directly from the LiveTranscription
class.
A new release was just posted which should address this problem, please take a look: https://github.com/deepgram/deepgram-python-sdk/releases/tag/v3.0.0-alpha.1
Latest is alpha.4
with another release due out today
@roerohan alpha.5
is out and that commit is most likely going to be the beta.1
release. Have your y been able to try with this latest update?
Hi @dvonthenen
I'm currently using a workaround where I'm sending the socket messages directly using the _socket
object. I'll try out the newer version as soon as I get some time.
cool. If you run into any problems, please let me know.
Re-opened to take a look at when I have time. I am unfamiliar with v2 version, so this might take some time.
@SandraRodgers said she would take a look at this issue and the other one since she has more knowledge about the v2
client.
i have an issue not sure if it is a similar one: Could not open socket: type object 'LiveTranscriptionEvents' has no attribute 'Unhandled'
Description
I'm using v2.11.0 of your SDK and I often run into this error in live transcriptions.
After this, none of the
send()
method calls on an instance of theLiveTranscription
object send any data over the socket.Debugging
It seems like the issue is here: https://github.com/deepgram/deepgram-python-sdk/blob/2135dc5b352f1d7832975b8c726392f3a2b67496/deepgram/transcription.py#L198
It appears that the code only checks if the socket is closed when there is a message timeout while waiting in the queue. However, if I insert a lot of messages in the queue (by calling the
send
method) whenself._socket.closed
isFalse
, and the socket closes later, the code will try to send the message over a closed socket at some point, resulting in the above error.Since there is no
try except
block, the error also causes thewhile
loop to exit, and therefore I'm not able to send any more messages using that object.