Skip to content

Commit 593e69f

Browse files
Annhiluccopybara-github
authored andcommitted
chore: Internal change
PiperOrigin-RevId: 896536012
1 parent aca7dcf commit 593e69f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

google/genai/_interactions/_base_client.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,10 @@ def _build_request(
550550
files = cast(HttpxRequestFiles, ForceMultipartDict())
551551

552552
prepared_url = self._prepare_url(options.url)
553+
# preserve hard-coded query params from the url
554+
if params and prepared_url.query:
555+
params = {**dict(prepared_url.params.items()), **params}
556+
prepared_url = prepared_url.copy_with(raw_path=prepared_url.raw_path.split(b"?", 1)[0])
553557
if "_" in prepared_url.host:
554558
# work around https://github.com/encode/httpx/discussions/2880
555559
kwargs["extensions"] = {"sni_hostname": prepared_url.host.replace("_", "-")}

0 commit comments

Comments
 (0)