Commit f24c9820

stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
2025-04-07 21:29:13
chore(deps): allow websockets v15 (#2281)
1 parent 41e74d4
Changed files (4)
src/openai/resources/beta/realtime/realtime.py
@@ -277,10 +277,6 @@ class AsyncRealtimeConnection:
         """
         message = await self._connection.recv(decode=False)
         log.debug(f"Received websocket message: %s", message)
-        if not isinstance(message, bytes):
-            # passing `decode=False` should always result in us getting `bytes` back
-            raise TypeError(f"Expected `.recv(decode=False)` to return `bytes` but got {type(message)}")
-
         return message
 
     async def send(self, event: RealtimeClientEvent | RealtimeClientEventParam) -> None:
@@ -461,10 +457,6 @@ class RealtimeConnection:
         """
         message = self._connection.recv(decode=False)
         log.debug(f"Received websocket message: %s", message)
-        if not isinstance(message, bytes):
-            # passing `decode=False` should always result in us getting `bytes` back
-            raise TypeError(f"Expected `.recv(decode=False)` to return `bytes` but got {type(message)}")
-
         return message
 
     def send(self, event: RealtimeClientEvent | RealtimeClientEventParam) -> None:
pyproject.toml
@@ -43,7 +43,7 @@ Repository = "https://github.com/openai/openai-python"
 openai = "openai.cli:main"
 
 [project.optional-dependencies]
-realtime = ["websockets >= 13, < 15"]
+realtime = ["websockets >= 13, < 16"]
 datalib = ["numpy >= 1", "pandas >= 1.2.3", "pandas-stubs >= 1.1.0.11"]
 voice_helpers = ["sounddevice>=0.5.1", "numpy>=2.0.2"]
 
requirements-dev.lock
@@ -188,7 +188,7 @@ urllib3==2.2.1
     # via requests
 virtualenv==20.24.5
     # via nox
-websockets==14.2
+websockets==15.0.1
     # via openai
 zipp==3.17.0
     # via importlib-metadata
requirements.lock
@@ -70,5 +70,5 @@ typing-extensions==4.12.2
     # via pydantic-core
 tzdata==2024.1
     # via pandas
-websockets==14.2
+websockets==15.0.1
     # via openai