From 30b8c013334553f994379d10f762de3826edcbce Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Apr 2026 02:06:12 +0000 Subject: [PATCH 1/2] fix(client): preserve hardcoded query params when merging with user params --- src/retell/_base_client.py | 4 ++++ tests/test_client.py | 48 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/src/retell/_base_client.py b/src/retell/_base_client.py index 6c7320e1..67362364 100644 --- a/src/retell/_base_client.py +++ b/src/retell/_base_client.py @@ -540,6 +540,10 @@ def _build_request( files = cast(HttpxRequestFiles, ForceMultipartDict()) prepared_url = self._prepare_url(options.url) + # preserve hard-coded query params from the url + if params and prepared_url.query: + params = {**dict(prepared_url.params.items()), **params} + prepared_url = prepared_url.copy_with(raw_path=prepared_url.raw_path.split(b"?", 1)[0]) if "_" in prepared_url.host: # work around https://github.com/encode/httpx/discussions/2880 kwargs["extensions"] = {"sni_hostname": prepared_url.host.replace("_", "-")} diff --git a/tests/test_client.py b/tests/test_client.py index 65b5beb7..1c9be6ab 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -427,6 +427,30 @@ def test_default_query_option(self) -> None: client.close() + def test_hardcoded_query_params_in_url(self, client: Retell) -> None: + request = client._build_request(FinalRequestOptions(method="get", url="/foo?beta=true")) + url = httpx.URL(request.url) + assert dict(url.params) == {"beta": "true"} + + request = client._build_request( + FinalRequestOptions( + method="get", + url="/foo?beta=true", + params={"limit": "10", "page": "abc"}, + ) + ) + url = httpx.URL(request.url) + assert dict(url.params) == {"beta": "true", "limit": "10", "page": "abc"} + + request = client._build_request( + FinalRequestOptions( + method="get", + url="/files/a%2Fb?beta=true", + params={"limit": "10"}, + ) + ) + assert request.url.raw_path == b"/files/a%2Fb?beta=true&limit=10" + def test_request_extra_json(self, client: Retell) -> None: request = client._build_request( FinalRequestOptions( @@ -1346,6 +1370,30 @@ async def test_default_query_option(self) -> None: await client.close() + async def test_hardcoded_query_params_in_url(self, async_client: AsyncRetell) -> None: + request = async_client._build_request(FinalRequestOptions(method="get", url="/foo?beta=true")) + url = httpx.URL(request.url) + assert dict(url.params) == {"beta": "true"} + + request = async_client._build_request( + FinalRequestOptions( + method="get", + url="/foo?beta=true", + params={"limit": "10", "page": "abc"}, + ) + ) + url = httpx.URL(request.url) + assert dict(url.params) == {"beta": "true", "limit": "10", "page": "abc"} + + request = async_client._build_request( + FinalRequestOptions( + method="get", + url="/files/a%2Fb?beta=true", + params={"limit": "10"}, + ) + ) + assert request.url.raw_path == b"/files/a%2Fb?beta=true&limit=10" + def test_request_extra_json(self, client: Retell) -> None: request = client._build_request( FinalRequestOptions( From d7ded970b227d270aa489441af4489246d6318c1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Apr 2026 02:06:31 +0000 Subject: [PATCH 2/2] release: 5.25.1 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ pyproject.toml | 2 +- src/retell/_version.py | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 8f3c6b87..1040019e 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "5.25.0" + ".": "5.25.1" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index e7ff9f50..3e3dc5d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 5.25.1 (2026-04-08) + +Full Changelog: [v5.25.0...v5.25.1](https://github.com/RetellAI/retell-python-sdk/compare/v5.25.0...v5.25.1) + +### Bug Fixes + +* **client:** preserve hardcoded query params when merging with user params ([30b8c01](https://github.com/RetellAI/retell-python-sdk/commit/30b8c013334553f994379d10f762de3826edcbce)) + ## 5.25.0 (2026-04-02) Full Changelog: [v5.24.0...v5.25.0](https://github.com/RetellAI/retell-python-sdk/compare/v5.24.0...v5.25.0) diff --git a/pyproject.toml b/pyproject.toml index c0ab189b..ad59b855 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "retell-sdk" -version = "5.25.0" +version = "5.25.1" description = "The official Python library for the retell API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/retell/_version.py b/src/retell/_version.py index 350f586d..fab01d1e 100644 --- a/src/retell/_version.py +++ b/src/retell/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "retell" -__version__ = "5.25.0" # x-release-please-version +__version__ = "5.25.1" # x-release-please-version