From fc82b81de5d11cfd7a38049bf77cab7b69cef948 Mon Sep 17 00:00:00 2001 From: Sameerlite Date: Sun, 28 Sep 2025 10:06:59 +0530 Subject: [PATCH] fix mypy --- litellm/proxy/pass_through_endpoints/pass_through_endpoints.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/litellm/proxy/pass_through_endpoints/pass_through_endpoints.py b/litellm/proxy/pass_through_endpoints/pass_through_endpoints.py index e0e6667bc9a..2019c9a3aaa 100644 --- a/litellm/proxy/pass_through_endpoints/pass_through_endpoints.py +++ b/litellm/proxy/pass_through_endpoints/pass_through_endpoints.py @@ -1280,6 +1280,9 @@ async def websocket_passthrough_request( # noqa: PLR0915 try: # Wait for the first response from upstream raw_response = await upstream_ws.recv(decode=False) + # Ensure raw_response is bytes before decoding + if isinstance(raw_response, str): + raw_response = raw_response.encode("ascii") setup_response = json.loads(raw_response.decode("ascii")) verbose_proxy_logger.debug(f"Setup response: {setup_response}")