mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-03 02:22:24 +00:00
fix(passthrough): only fall back to url query when client sends none
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
b6f97a51d2
commit
94771abd84
2 changed files with 3 additions and 15 deletions
|
|
@ -986,10 +986,7 @@ async def pass_through_request(
|
|||
forward_headers=forward_headers,
|
||||
)
|
||||
|
||||
requested_query_params: dict | None = {
|
||||
**dict(url.params),
|
||||
**(query_params or dict(request.query_params)),
|
||||
} or None
|
||||
requested_query_params: dict | None = query_params or dict(request.query_params) or None
|
||||
|
||||
endpoint_type: Final[EndpointType] = HttpPassThroughEndpointHelpers.get_endpoint_type(str(url))
|
||||
|
||||
|
|
|
|||
|
|
@ -2529,12 +2529,12 @@ async def test_pass_through_request_default_query_params_reach_the_wire():
|
|||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_pass_through_request_without_merge_preserves_target_query():
|
||||
async def test_pass_through_request_without_merge_replaces_target_query():
|
||||
wire_url = await _run_pass_through_and_capture_wire_url(
|
||||
target="https://www.bing.com/search?setLang=en-US",
|
||||
incoming_query="q=litellm",
|
||||
)
|
||||
assert dict(wire_url.params) == {"setLang": "en-US", "q": "litellm"}
|
||||
assert dict(wire_url.params) == {"q": "litellm"}
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
|
|
@ -2546,15 +2546,6 @@ async def test_pass_through_request_preserves_target_query_without_client_query(
|
|||
assert dict(wire_url.params) == {"alt": "sse"}
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_pass_through_request_preserves_target_query_with_client_query():
|
||||
wire_url = await _run_pass_through_and_capture_wire_url(
|
||||
target="https://example.com/v1/models/gemini:streamGenerateContent?alt=sse",
|
||||
incoming_query="key=abc",
|
||||
)
|
||||
assert dict(wire_url.params) == {"alt": "sse", "key": "abc"}
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_pass_through_request_merge_query_params_rewrites_managed_ids_on_the_wire():
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue