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

Not sure whats going on could use some help #1

Open
davtin19 opened this issue Nov 2, 2024 · 2 comments
Open

Not sure whats going on could use some help #1

davtin19 opened this issue Nov 2, 2024 · 2 comments

Comments

@davtin19
Copy link

davtin19 commented Nov 2, 2024

I keep running into this error and im not sure whats the issue all my api keys and url should be correct i double checked

I keep getting this error when i try running it
╭─    ~/samantha-os1/app    main = !1 
╰─ chainlit run samantha.py ─╯
2024-11-02 13:02:15 - Your app is available at http://localhost:8000
2024-11-02 13:02:17 - Translated markdown file for en-US not found. Defaulting to chainlit.md.
2024-11-02 13:02:37 - Translation file for en-CA not found. Using default translation en-US.
2024-11-02 13:02:37 - Translated markdown file for en-CA not found. Defaulting to chainlit.md.
Traceback (most recent call last):
File "/Users/davidtingey/samantha-os1/.venv/lib/python3.12/site-packages/websockets/legacy/client.py", line 656, in await_impl
await protocol.handshake(
File "/Users/davidtingey/samantha-os1/.venv/lib/python3.12/site-packages/websockets/legacy/client.py", line 322, in handshake
raise InvalidStatusCode(status_code, response_headers)
websockets.legacy.exceptions.InvalidStatusCode: server rejected WebSocket connection: HTTP 400

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/davidtingey/samantha-os1/.venv/lib/python3.12/site-packages/websockets/legacy/client.py", line 670, in await_impl
await protocol.wait_closed()
File "/Users/davidtingey/samantha-os1/.venv/lib/python3.12/site-packages/websockets/legacy/protocol.py", line 799, in wait_closed
await asyncio.shield(self.connection_lost_waiter)
File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/futures.py", line 287, in await
yield self # This tells Task to wait for completion.
^^^^^^^^^^
File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/tasks.py", line 385, in __wakeup
future.result()
File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/futures.py", line 198, in result
raise exc
asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/Users/davidtingey/samantha-os1/app/samantha.py", line 94, in on_audio_start
await openai_realtime.connect()
File "/Users/davidtingey/samantha-os1/app/realtime/init.py", line 582, in connect
await self.realtime.connect()
File "/Users/davidtingey/samantha-os1/app/realtime/init.py", line 132, in connect
self.ws = await websockets.connect(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidtingey/samantha-os1/.venv/lib/python3.12/site-packages/websockets/legacy/client.py", line 652, in await_impl
async with asyncio_timeout(self.open_timeout):
File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/timeouts.py", line 115, in aexit
raise TimeoutError from exc_val
TimeoutError

Traceback (most recent call last):
File "/Users/davidtingey/samantha-os1/.venv/lib/python3.12/site-packages/websockets/legacy/client.py", line 656, in await_impl
await protocol.handshake(
File "/Users/davidtingey/samantha-os1/.venv/lib/python3.12/site-packages/websockets/legacy/client.py", line 322, in handshake
raise InvalidStatusCode(status_code, response_headers)
websockets.legacy.exceptions.InvalidStatusCode: server rejected WebSocket connection: HTTP 400

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/davidtingey/samantha-os1/.venv/lib/python3.12/site-packages/websockets/legacy/client.py", line 670, in await_impl
await protocol.wait_closed()
File "/Users/davidtingey/samantha-os1/.venv/lib/python3.12/site-packages/websockets/legacy/protocol.py", line 799, in wait_closed
await asyncio.shield(self.connection_lost_waiter)
File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/futures.py", line 287, in await
yield self # This tells Task to wait for completion.
^^^^^^^^^^
File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/tasks.py", line 385, in __wakeup
future.result()
File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/futures.py", line 198, in result
raise exc
asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/Users/davidtingey/samantha-os1/app/samantha.py", line 94, in on_audio_start
await openai_realtime.connect()
File "/Users/davidtingey/samantha-os1/app/realtime/init.py", line 582, in connect
await self.realtime.connect()
File "/Users/davidtingey/samantha-os1/app/realtime/init.py", line 132, in connect
self.ws = await websockets.connect(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/davidtingey/samantha-os1/.venv/lib/python3.12/site-packages/websockets/legacy/client.py", line 652, in await_impl
async with asyncio_timeout(self.open_timeout):
File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/timeouts.py", line 115, in aexit
raise TimeoutError from exc_val
TimeoutError

@davtin19
Copy link
Author

davtin19 commented Nov 2, 2024

Also the error only whens when I press P to activate voice mode and the bot says this

Failed to connect to OpenAI realtime:

@sbusso
Copy link

sbusso commented Nov 4, 2024

I got a similar issue due to the Azure OpenAI URL. It should refer to only the domain AZURE_OPENAI_URL='endpoint-name.openai.azure.com'

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

No branches or pull requests

2 participants