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(types): fix mypy errors in pass-through endpoint query param types

Julio Quinteros Prof3003a98401d
diff --git a/litellm/passthrough/utils.py b/litellm/passthrough/utils.py
index 74af02e5e62..fe1ecad96c2 100644
--- a/litellm/passthrough/utils.py
+++ b/litellm/passthrough/utils.py
@@ -1,4 +1,4 @@
-from typing import Dict, List, Optional, Union
+from typing import Dict, List, Mapping, Optional, Union
from urllib.parse import parse_qs
import httpx
@@ -10,7 +10,7 @@ class BasePassthroughUtils:
@staticmethod
def get_merged_query_parameters(
existing_url: httpx.URL,
- request_query_params: Dict[str, Union[str, list]],
+ request_query_params: Mapping[str, Union[str, list]],
default_query_params: Optional[Dict[str, Union[str, list]]] = None
) -> Dict[str, Union[str, List[str]]]:
# Get the existing query params from the target URL
diff --git a/litellm/proxy/pass_through_endpoints/pass_through_endpoints.py b/litellm/proxy/pass_through_endpoints/pass_through_endpoints.py
index 883e90f8fef..d1c4b8b3403 100644
--- a/litellm/proxy/pass_through_endpoints/pass_through_endpoints.py
+++ b/litellm/proxy/pass_through_endpoints/pass_through_endpoints.py
@@ -1221,7 +1221,7 @@ def create_pass_through_route(
forward_headers=cast(Optional[bool], param_forward_headers),
merge_query_params=cast(Optional[bool], param_merge_query_params),
query_params=final_query_params,
- default_query_params=param_default_query_params,
+ default_query_params=cast(Optional[dict], param_default_query_params),
stream=is_streaming_request or stream,
custom_body=final_custom_body,
cost_per_request=cast(Optional[float], param_cost_per_request),