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]

fixed linting

shivam733ccd6e0920
diff --git a/litellm/proxy/middleware/prometheus_auth_middleware.py b/litellm/proxy/middleware/prometheus_auth_middleware.py
index d0e38f98946..d5dec6c4bda 100644
--- a/litellm/proxy/middleware/prometheus_auth_middleware.py
+++ b/litellm/proxy/middleware/prometheus_auth_middleware.py
@@ -2,7 +2,7 @@
Prometheus Auth Middleware - Pure ASGI implementation
"""
import json
-from typing import List
+from typing import Any, List, MutableMapping
from fastapi import Request
from starlette.types import ASGIApp, Receive, Scope, Send
@@ -43,9 +43,9 @@ class PrometheusAuthMiddleware:
# user_api_key_auth reads the request body, which consumes ASGI `receive`.
# Buffer those messages and replay them for the inner app; otherwise a
# successful auth would forward an exhausted receive and /metrics hangs.
- buffered_messages: List[dict] = []
+ buffered_messages: List[MutableMapping[str, Any]] = []
- async def receive_for_auth() -> dict:
+ async def receive_for_auth() -> MutableMapping[str, Any]:
message = await receive()
buffered_messages.append(message)
return message
@@ -81,7 +81,7 @@ class PrometheusAuthMiddleware:
replay_idx = 0
- async def receive_replay() -> dict:
+ async def receive_replay() -> MutableMapping[str, Any]:
nonlocal replay_idx
if replay_idx < len(buffered_messages):
msg = buffered_messages[replay_idx]