We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
def init_deepgram(): def on_message(self, result, **kwargs): print("on_message") sentence = result.channel.alternatives[0].transcript if len(sentence) == 0: return print(f"Deepgram transcription: {sentence}") def on_error(self, error, **kwargs): print(f"Deepgram error: {error}") config = DeepgramClientOptions( api_key=os.getenv("DEEPGRAM_API_KEY"), options={"keepalive": "true"}, ) deepgram = DeepgramClient(config) dg_connection = deepgram.listen.websocket.v("1") dg_connection.on(LiveTranscriptionEvents.Transcript, on_message) dg_connection.on(LiveTranscriptionEvents.Error, on_error) options = LiveOptions( punctuate=True, language="en-US", vad_events=True, ) return dg_connection.start(options) init_deepgram()
WebSocketException in AbstractSyncWebSocketClient.start: server rejected WebSocket connection: HTTP 401 ListenWebSocketClient.start failed
I expect it to open the websocket connection successfully
OS: Tried on Windows and Windows Subsystem for Linux, failed on both Python version: Python 3.10.12 deepgram-sdk 3.7.7 websockets 13.1
I know that I'm populating the API key correctly because I tried printing it out
The text was updated successfully, but these errors were encountered:
I found a workaround for the above issue, but found what seems to be another bug
I had to pass in the api key to DeepgramClient. It did NOT work if I pass in api key to DeepgramClientOptions
Sorry, something went wrong.
No branches or pull requests
What is the current behavior?
Expected behavior
I expect it to open the websocket connection successfully
Please tell us about your environment
OS: Tried on Windows and Windows Subsystem for Linux, failed on both
Python version: Python 3.10.12
deepgram-sdk 3.7.7
websockets 13.1
Anything else we should know
I know that I'm populating the API key correctly because I tried printing it out
The text was updated successfully, but these errors were encountered: