Skip to content
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

Deepgram SDK Fails with WebSocket Version 14.0 - Unexpected Keyword Argument extra_headers #483

Open
artstyle46 opened this issue Nov 11, 2024 · 4 comments · May be fixed by #486
Open

Deepgram SDK Fails with WebSocket Version 14.0 - Unexpected Keyword Argument extra_headers #483

artstyle46 opened this issue Nov 11, 2024 · 4 comments · May be fixed by #486

Comments

@artstyle46
Copy link

artstyle46 commented Nov 11, 2024

What is the current behavior?

When using the Deepgram SDK with WebSocket version 14.0, the connection fails, and the following error is raised:

TypeError: got an unexpected keyword argument 'extra_headers'.
However, Deepgram works fine with WebSocket version 13.1.

Steps to reproduce

Install WebSocket version 14.0
pip install websockets==14.0
Set up a Deepgram connection using the SDK.
pip install deepgram-sdk==3.7.6
Attempt to create a connection to Deepgram's API using
deepgram: DeepgramClient = DeepgramClient(DeepgramClientOptions(options={"keepalive": "true"} ))
dg_connection = deepgram.listen.asyncwebsocket.v("1")
options: LiveOptions = LiveOptions( model="nova-2-general", smart_format=True, punctuate=True, encoding="linear16", channels=1, sample_rate=8000, vad_events=True, )
dg_connection.start(options=options)
Observe the error: TypeError: got an unexpected keyword argument 'extra_headers'.

Expected behavior

The connection should be established successfully without any errors when using WebSocket version 14.0, similar to the behavior with version 13.1.

Please tell us about your environment

MacOS 14.6.1
python version v3.12.6

Other information

@kozzion
Copy link

kozzion commented Nov 12, 2024

Yeah have the same problem, fixing to version 13.1 solves the problem for me pushing back deepgram version does not.

@SishaarRao
Copy link

Having the same problem, staying on major version 13 resolved the issue

@xzys
Copy link

xzys commented Nov 20, 2024

The issue seems to be that the Python websockets library seems to accept additional_headers not extra_headers
https://github.com/python-websockets/websockets/blob/main/src/websockets/asyncio/client.py#L79

@xzys xzys linked a pull request Nov 20, 2024 that will close this issue
8 tasks
@kozzion
Copy link

kozzion commented Nov 21, 2024

Maybe it should look through the args for "extra headers, additional headers, more headers, suplementary headers"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants