Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

fix(mypy): add union-attr suppression to all backend_ws method calls

Julio Quinteros Pro21d958e46d61
diff --git a/litellm/litellm_core_utils/realtime_streaming.py b/litellm/litellm_core_utils/realtime_streaming.py
index 760efa71ab7..449a4892621 100644
--- a/litellm/litellm_core_utils/realtime_streaming.py
+++ b/litellm/litellm_core_utils/realtime_streaming.py
@@ -502,11 +502,11 @@ class RealTimeStreaming:
try:
while True:
try:
- raw_response = await self.backend_ws.recv(
+ raw_response = await self.backend_ws.recv( # type: ignore[union-attr]
decode=False
) # improves performance
except TypeError:
- raw_response = await self.backend_ws.recv() # type: ignore[assignment]
+ raw_response = await self.backend_ws.recv() # type: ignore[union-attr, assignment]
if self.provider_config:
try:
@@ -573,9 +573,9 @@ class RealTimeStreaming:
)
for msg in message:
- await self.backend_ws.send(msg)
+ await self.backend_ws.send(msg) # type: ignore[union-attr]
else:
- await self.backend_ws.send(message)
+ await self.backend_ws.send(message) # type: ignore[union-attr]
except Exception as e:
verbose_logger.debug(f"Error in client ack messages: {e}")