From 34e675cc46fadc88539fb6f560275876311e4c13 Mon Sep 17 00:00:00 2001 From: Sam Sykes Date: Mon, 12 Jan 2026 09:59:29 +0000 Subject: [PATCH 01/12] handle client URL parameters --- sdk/voice/speechmatics/voice/_client.py | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/sdk/voice/speechmatics/voice/_client.py b/sdk/voice/speechmatics/voice/_client.py index b3cc134..2cd3048 100644 --- a/sdk/voice/speechmatics/voice/_client.py +++ b/sdk/voice/speechmatics/voice/_client.py @@ -14,7 +14,10 @@ from typing import Callable from typing import Optional from typing import Union +from urllib.parse import parse_qs from urllib.parse import urlencode +from urllib.parse import urlparse +from urllib.parse import urlunparse from speechmatics.rt import AsyncClient from speechmatics.rt import AudioEncoding @@ -1917,9 +1920,19 @@ def _get_endpoint_url(self, url: str, app: Optional[str] = None) -> str: str: The formatted endpoint URL. """ - query_params = {} - query_params["sm-app"] = app or f"voice-sdk/{__version__}" - query_params["sm-voice-sdk"] = f"{__version__}" - query = urlencode(query_params) + # Parse the URL to extract existing query parameters + parsed = urlparse(url) + existing_params = parse_qs(parsed.query, keep_blank_values=True) - return f"{url}?{query}" + # Flatten existing params (parse_qs returns lists) + flattened_params = {k: v[0] if len(v) == 1 else v for k, v in existing_params.items()} + + # Add/update with new SDK parameters + flattened_params["sm-app"] = app or f"voice-sdk/{__version__}" + flattened_params["sm-voice-sdk"] = f"{__version__}" + + # Encode all parameters + query = urlencode(flattened_params) + + # Reconstruct the URL with merged parameters + return urlunparse((parsed.scheme, parsed.netloc, parsed.path, parsed.params, query, parsed.fragment)) From a5e3f3023169cdc25b11c9ff1ecccbbe942f3aba Mon Sep 17 00:00:00 2001 From: Sam Sykes Date: Mon, 12 Jan 2026 10:11:09 +0000 Subject: [PATCH 02/12] updated param handling --- sdk/voice/speechmatics/voice/_client.py | 2 +- tests/voice/test_16_url.py | 29 +++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 tests/voice/test_16_url.py diff --git a/sdk/voice/speechmatics/voice/_client.py b/sdk/voice/speechmatics/voice/_client.py index 2cd3048..9842f6f 100644 --- a/sdk/voice/speechmatics/voice/_client.py +++ b/sdk/voice/speechmatics/voice/_client.py @@ -1928,7 +1928,7 @@ def _get_endpoint_url(self, url: str, app: Optional[str] = None) -> str: flattened_params = {k: v[0] if len(v) == 1 else v for k, v in existing_params.items()} # Add/update with new SDK parameters - flattened_params["sm-app"] = app or f"voice-sdk/{__version__}" + flattened_params["sm-app"] = app or flattened_params.get("sm-app", f"voice-sdk/{__version__}") flattened_params["sm-voice-sdk"] = f"{__version__}" # Encode all parameters diff --git a/tests/voice/test_16_url.py b/tests/voice/test_16_url.py new file mode 100644 index 0000000..f47a18e --- /dev/null +++ b/tests/voice/test_16_url.py @@ -0,0 +1,29 @@ +import pytest +from _utils import get_client + + +@pytest.mark.asyncio +async def test_esl(): + """Local ESL inference.""" + + # Client + client = await get_client( + api_key="DUMMY", + connect=False, + ) + + # URL test #1 - no extra params + url = client._get_endpoint_url("wss://dummy:1234/ep", "dummy-0.1.2") + assert url == "wss://dummy:1234/ep?sm-app=dummy-0.1.2&sm-voice-sdk=0.0.0" + + # URL test #2 - with extra params + url = client._get_endpoint_url("wss://dummy:1234/ep?client=amz", "dummy-0.1.2") + assert url == "wss://dummy:1234/ep?client=amz&sm-app=dummy-0.1.2&sm-voice-sdk=0.0.0" + + # URL test #3 - with sm-app param + url = client._get_endpoint_url("wss://dummy:1234/ep?sm-app=dummy") + assert url == "wss://dummy:1234/ep?sm-app=dummy&sm-voice-sdk=0.0.0" + + # URL test #4 - with sm-app param and different app + url = client._get_endpoint_url("wss://dummy:1234/ep?sm-app=dummy", "dummy-0.1.2") + assert url == "wss://dummy:1234/ep?sm-app=dummy-0.1.2&sm-voice-sdk=0.0.0" From daa2a4a76c392e2e74ab141ccd2f0b2b74efd7af Mon Sep 17 00:00:00 2001 From: Sam Sykes Date: Mon, 12 Jan 2026 10:15:30 +0000 Subject: [PATCH 03/12] test other URL formats --- tests/voice/test_16_url.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/tests/voice/test_16_url.py b/tests/voice/test_16_url.py index f47a18e..e0d7b37 100644 --- a/tests/voice/test_16_url.py +++ b/tests/voice/test_16_url.py @@ -13,17 +13,21 @@ async def test_esl(): ) # URL test #1 - no extra params - url = client._get_endpoint_url("wss://dummy:1234/ep", "dummy-0.1.2") - assert url == "wss://dummy:1234/ep?sm-app=dummy-0.1.2&sm-voice-sdk=0.0.0" + url = client._get_endpoint_url("wss://dummy/ep", "dummy-0.1.2") + assert url == "wss://dummy/ep?sm-app=dummy-0.1.2&sm-voice-sdk=0.0.0" # URL test #2 - with extra params url = client._get_endpoint_url("wss://dummy:1234/ep?client=amz", "dummy-0.1.2") assert url == "wss://dummy:1234/ep?client=amz&sm-app=dummy-0.1.2&sm-voice-sdk=0.0.0" # URL test #3 - with sm-app param - url = client._get_endpoint_url("wss://dummy:1234/ep?sm-app=dummy") - assert url == "wss://dummy:1234/ep?sm-app=dummy&sm-voice-sdk=0.0.0" + url = client._get_endpoint_url("wss://dummy/ep?sm-app=dummy") + assert url == "wss://dummy/ep?sm-app=dummy&sm-voice-sdk=0.0.0" # URL test #4 - with sm-app param and different app - url = client._get_endpoint_url("wss://dummy:1234/ep?sm-app=dummy", "dummy-0.1.2") - assert url == "wss://dummy:1234/ep?sm-app=dummy-0.1.2&sm-voice-sdk=0.0.0" + url = client._get_endpoint_url("ws://localhost:8080/ep?sm-app=dummy", "dummy-0.1.2") + assert url == "ws://localhost:8080/ep?sm-app=dummy-0.1.2&sm-voice-sdk=0.0.0" + + # URL test #5 - http endpoint (not actually possible, but a good test) + url = client._get_endpoint_url("http://dummy/ep", "dummy-0.1.2") + assert url == "http://dummy/ep?sm-app=dummy-0.1.2&sm-voice-sdk=0.0.0" From 4b8c1a913fcaf0994ee236b718f6b450cc99ec40 Mon Sep 17 00:00:00 2001 From: Sam Sykes Date: Mon, 12 Jan 2026 10:17:07 +0000 Subject: [PATCH 04/12] more complex URL tests --- tests/voice/test_16_url.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/voice/test_16_url.py b/tests/voice/test_16_url.py index e0d7b37..fb8a79f 100644 --- a/tests/voice/test_16_url.py +++ b/tests/voice/test_16_url.py @@ -29,5 +29,5 @@ async def test_esl(): assert url == "ws://localhost:8080/ep?sm-app=dummy-0.1.2&sm-voice-sdk=0.0.0" # URL test #5 - http endpoint (not actually possible, but a good test) - url = client._get_endpoint_url("http://dummy/ep", "dummy-0.1.2") - assert url == "http://dummy/ep?sm-app=dummy-0.1.2&sm-voice-sdk=0.0.0" + url = client._get_endpoint_url("http://dummy/ep/v1/", "dummy-0.1.2") + assert url == "http://dummy/ep/v1/?sm-app=dummy-0.1.2&sm-voice-sdk=0.0.0" From 0858a76d503e3e3b208c01ea00d0b2edac27a5cf Mon Sep 17 00:00:00 2001 From: Sam Sykes Date: Mon, 12 Jan 2026 10:18:02 +0000 Subject: [PATCH 05/12] fix to test name --- tests/voice/test_16_url.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/voice/test_16_url.py b/tests/voice/test_16_url.py index fb8a79f..2f1a8c4 100644 --- a/tests/voice/test_16_url.py +++ b/tests/voice/test_16_url.py @@ -3,8 +3,8 @@ @pytest.mark.asyncio -async def test_esl(): - """Local ESL inference.""" +async def test_url_endpoints(): + """Test URL endpoint construction.""" # Client client = await get_client( From 46e37fdaa280ace97095a79b30ba2290a8df8b64 Mon Sep 17 00:00:00 2001 From: Sam Sykes Date: Mon, 12 Jan 2026 10:24:50 +0000 Subject: [PATCH 06/12] test with no sm-app provided --- tests/voice/test_16_url.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/voice/test_16_url.py b/tests/voice/test_16_url.py index 2f1a8c4..1985d0d 100644 --- a/tests/voice/test_16_url.py +++ b/tests/voice/test_16_url.py @@ -31,3 +31,7 @@ async def test_url_endpoints(): # URL test #5 - http endpoint (not actually possible, but a good test) url = client._get_endpoint_url("http://dummy/ep/v1/", "dummy-0.1.2") assert url == "http://dummy/ep/v1/?sm-app=dummy-0.1.2&sm-voice-sdk=0.0.0" + + # URL test #6 - no app + url = client._get_endpoint_url("wss://dummy/ep") + assert url == "wss://dummy/ep?sm-app=voice-sdk%2F0.0.0&sm-voice-sdk=0.0.0" From b532ae415b6ec49f40c50c20f91d124b6ccfa194 Mon Sep 17 00:00:00 2001 From: Sam Sykes Date: Mon, 12 Jan 2026 10:30:46 +0000 Subject: [PATCH 07/12] use __version__ properly --- tests/voice/test_16_url.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/voice/test_16_url.py b/tests/voice/test_16_url.py index 1985d0d..42ff908 100644 --- a/tests/voice/test_16_url.py +++ b/tests/voice/test_16_url.py @@ -1,6 +1,8 @@ import pytest from _utils import get_client +from speechmatics.voice import __version__ + @pytest.mark.asyncio async def test_url_endpoints(): @@ -14,24 +16,24 @@ async def test_url_endpoints(): # URL test #1 - no extra params url = client._get_endpoint_url("wss://dummy/ep", "dummy-0.1.2") - assert url == "wss://dummy/ep?sm-app=dummy-0.1.2&sm-voice-sdk=0.0.0" + assert url == f"wss://dummy/ep?sm-app=dummy-0.1.2&sm-voice-sdk={__version__}" # URL test #2 - with extra params url = client._get_endpoint_url("wss://dummy:1234/ep?client=amz", "dummy-0.1.2") - assert url == "wss://dummy:1234/ep?client=amz&sm-app=dummy-0.1.2&sm-voice-sdk=0.0.0" + assert url == f"wss://dummy:1234/ep?client=amz&sm-app=dummy-0.1.2&sm-voice-sdk={__version__}" # URL test #3 - with sm-app param url = client._get_endpoint_url("wss://dummy/ep?sm-app=dummy") - assert url == "wss://dummy/ep?sm-app=dummy&sm-voice-sdk=0.0.0" + assert url == f"wss://dummy/ep?sm-app=dummy&sm-voice-sdk={__version__}" # URL test #4 - with sm-app param and different app url = client._get_endpoint_url("ws://localhost:8080/ep?sm-app=dummy", "dummy-0.1.2") - assert url == "ws://localhost:8080/ep?sm-app=dummy-0.1.2&sm-voice-sdk=0.0.0" + assert url == f"ws://localhost:8080/ep?sm-app=dummy-0.1.2&sm-voice-sdk={__version__}" # URL test #5 - http endpoint (not actually possible, but a good test) url = client._get_endpoint_url("http://dummy/ep/v1/", "dummy-0.1.2") - assert url == "http://dummy/ep/v1/?sm-app=dummy-0.1.2&sm-voice-sdk=0.0.0" + assert url == f"http://dummy/ep/v1/?sm-app=dummy-0.1.2&sm-voice-sdk={__version__}" # URL test #6 - no app url = client._get_endpoint_url("wss://dummy/ep") - assert url == "wss://dummy/ep?sm-app=voice-sdk%2F0.0.0&sm-voice-sdk=0.0.0" + assert url == f"wss://dummy/ep?sm-app=voice-sdk%2F{__version__}&sm-voice-sdk={__version__}" From 96e4c402a1f763799eb5e3123f9a138b8886a7d0 Mon Sep 17 00:00:00 2001 From: Sam Sykes Date: Mon, 12 Jan 2026 12:24:54 +0000 Subject: [PATCH 08/12] Updated from comments --- sdk/voice/speechmatics/voice/_client.py | 23 ++++---- tests/voice/test_16_url.py | 74 +++++++++++++++++-------- 2 files changed, 62 insertions(+), 35 deletions(-) diff --git a/sdk/voice/speechmatics/voice/_client.py b/sdk/voice/speechmatics/voice/_client.py index 9842f6f..70bb4f1 100644 --- a/sdk/voice/speechmatics/voice/_client.py +++ b/sdk/voice/speechmatics/voice/_client.py @@ -1917,22 +1917,21 @@ def _get_endpoint_url(self, url: str, app: Optional[str] = None) -> str: app: The application name to use in the endpoint URL. Returns: - str: The formatted endpoint URL. + str: The formatted endpoint URL. """ # Parse the URL to extract existing query parameters parsed = urlparse(url) - existing_params = parse_qs(parsed.query, keep_blank_values=True) - # Flatten existing params (parse_qs returns lists) - flattened_params = {k: v[0] if len(v) == 1 else v for k, v in existing_params.items()} + # Extract existing params into a dict of lists, keeping params without values + params = parse_qs(parsed.query, keep_blank_values=True) - # Add/update with new SDK parameters - flattened_params["sm-app"] = app or flattened_params.get("sm-app", f"voice-sdk/{__version__}") - flattened_params["sm-voice-sdk"] = f"{__version__}" + # Use the provided app name, or fallback to existing value, or use the default string + existing_app = params.get("sm-app", [None])[0] + app_name = app or existing_app or f"voice-sdk/{__version__}" + params["sm-app"] = [app_name] + params["sm-voice-sdk"] = [__version__] - # Encode all parameters - query = urlencode(flattened_params) - - # Reconstruct the URL with merged parameters - return urlunparse((parsed.scheme, parsed.netloc, parsed.path, parsed.params, query, parsed.fragment)) + # Re-encode the query string and reconstruct + new_query = urlencode(params, doseq=True) + return urlunparse(parsed._replace(query=new_query)) diff --git a/tests/voice/test_16_url.py b/tests/voice/test_16_url.py index 42ff908..9960a7a 100644 --- a/tests/voice/test_16_url.py +++ b/tests/voice/test_16_url.py @@ -1,11 +1,59 @@ +from dataclasses import dataclass +from typing import Optional + import pytest from _utils import get_client from speechmatics.voice import __version__ +@dataclass +class URLExample: + input_url: str + input_app: Optional[str] = None + expected_url: str = "" + + +URLS: list[URLExample] = [ + URLExample( + input_url="wss://dummy/ep", + input_app="dummy-0.1.2", + expected_url="wss://dummy/ep?sm-app=dummy-0.1.2&sm-voice-sdk={v}", + ), + URLExample( + input_url="wss://dummy:1234/ep?client=amz", + input_app="dummy-0.1.2", + expected_url="wss://dummy:1234/ep?client=amz&sm-app=dummy-0.1.2&sm-voice-sdk={v}", + ), + URLExample( + input_url="wss://dummy/ep?sm-app=dummy", + expected_url="wss://dummy/ep?sm-app=dummy&sm-voice-sdk={v}", + ), + URLExample( + input_url="ws://localhost:8080/ep?sm-app=dummy", + input_app="dummy-0.1.2", + expected_url="ws://localhost:8080/ep?sm-app=dummy-0.1.2&sm-voice-sdk={v}", + ), + URLExample( + input_url="http://dummy/ep/v1/", + input_app="dummy-0.1.2", + expected_url="http://dummy/ep/v1/?sm-app=dummy-0.1.2&sm-voice-sdk={v}", + ), + URLExample( + input_url="wss://dummy/ep", + expected_url="wss://dummy/ep?sm-app=voice-sdk%2F0.0.0&sm-voice-sdk={v}", + ), + URLExample( + input_url="wss://dummy/ep", + input_app="client/a#b:c^d", + expected_url="wss://dummy/ep?sm-app=client%2Fa%23b%3Ac%5Ed&sm-voice-sdk={v}", + ), +] + + @pytest.mark.asyncio -async def test_url_endpoints(): +@pytest.mark.parametrize("test", URLS, ids=lambda s: s.input_url) +async def test_url_endpoints(test: URLExample): """Test URL endpoint construction.""" # Client @@ -15,25 +63,5 @@ async def test_url_endpoints(): ) # URL test #1 - no extra params - url = client._get_endpoint_url("wss://dummy/ep", "dummy-0.1.2") - assert url == f"wss://dummy/ep?sm-app=dummy-0.1.2&sm-voice-sdk={__version__}" - - # URL test #2 - with extra params - url = client._get_endpoint_url("wss://dummy:1234/ep?client=amz", "dummy-0.1.2") - assert url == f"wss://dummy:1234/ep?client=amz&sm-app=dummy-0.1.2&sm-voice-sdk={__version__}" - - # URL test #3 - with sm-app param - url = client._get_endpoint_url("wss://dummy/ep?sm-app=dummy") - assert url == f"wss://dummy/ep?sm-app=dummy&sm-voice-sdk={__version__}" - - # URL test #4 - with sm-app param and different app - url = client._get_endpoint_url("ws://localhost:8080/ep?sm-app=dummy", "dummy-0.1.2") - assert url == f"ws://localhost:8080/ep?sm-app=dummy-0.1.2&sm-voice-sdk={__version__}" - - # URL test #5 - http endpoint (not actually possible, but a good test) - url = client._get_endpoint_url("http://dummy/ep/v1/", "dummy-0.1.2") - assert url == f"http://dummy/ep/v1/?sm-app=dummy-0.1.2&sm-voice-sdk={__version__}" - - # URL test #6 - no app - url = client._get_endpoint_url("wss://dummy/ep") - assert url == f"wss://dummy/ep?sm-app=voice-sdk%2F{__version__}&sm-voice-sdk={__version__}" + url = client._get_endpoint_url(test.input_url, test.input_app) + assert url == test.expected_url.format(v=__version__) From 05d6920de38baf90580824d50a81c0f7cf04127a Mon Sep 17 00:00:00 2001 From: Sam Sykes Date: Mon, 12 Jan 2026 12:27:52 +0000 Subject: [PATCH 09/12] comment correction --- tests/voice/test_16_url.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/voice/test_16_url.py b/tests/voice/test_16_url.py index 9960a7a..b5d0f75 100644 --- a/tests/voice/test_16_url.py +++ b/tests/voice/test_16_url.py @@ -62,6 +62,6 @@ async def test_url_endpoints(test: URLExample): connect=False, ) - # URL test #1 - no extra params + # URL test url = client._get_endpoint_url(test.input_url, test.input_app) assert url == test.expected_url.format(v=__version__) From 4d796c22b1f525a95b042dc39d0d6d34ff07eab1 Mon Sep 17 00:00:00 2001 From: Sam Sykes Date: Mon, 12 Jan 2026 12:42:10 +0000 Subject: [PATCH 10/12] more strict tests --- tests/voice/test_16_url.py | 39 ++++++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/tests/voice/test_16_url.py b/tests/voice/test_16_url.py index b5d0f75..2a94baf 100644 --- a/tests/voice/test_16_url.py +++ b/tests/voice/test_16_url.py @@ -1,5 +1,7 @@ from dataclasses import dataclass from typing import Optional +from urllib.parse import parse_qs +from urllib.parse import urlparse import pytest from _utils import get_client @@ -11,42 +13,34 @@ class URLExample: input_url: str input_app: Optional[str] = None - expected_url: str = "" URLS: list[URLExample] = [ URLExample( input_url="wss://dummy/ep", input_app="dummy-0.1.2", - expected_url="wss://dummy/ep?sm-app=dummy-0.1.2&sm-voice-sdk={v}", ), URLExample( input_url="wss://dummy:1234/ep?client=amz", input_app="dummy-0.1.2", - expected_url="wss://dummy:1234/ep?client=amz&sm-app=dummy-0.1.2&sm-voice-sdk={v}", ), URLExample( input_url="wss://dummy/ep?sm-app=dummy", - expected_url="wss://dummy/ep?sm-app=dummy&sm-voice-sdk={v}", ), URLExample( input_url="ws://localhost:8080/ep?sm-app=dummy", input_app="dummy-0.1.2", - expected_url="ws://localhost:8080/ep?sm-app=dummy-0.1.2&sm-voice-sdk={v}", ), URLExample( input_url="http://dummy/ep/v1/", input_app="dummy-0.1.2", - expected_url="http://dummy/ep/v1/?sm-app=dummy-0.1.2&sm-voice-sdk={v}", ), URLExample( input_url="wss://dummy/ep", - expected_url="wss://dummy/ep?sm-app=voice-sdk%2F0.0.0&sm-voice-sdk={v}", ), URLExample( input_url="wss://dummy/ep", input_app="client/a#b:c^d", - expected_url="wss://dummy/ep?sm-app=client%2Fa%23b%3Ac%5Ed&sm-voice-sdk={v}", ), ] @@ -62,6 +56,31 @@ async def test_url_endpoints(test: URLExample): connect=False, ) + # Parse the input parameters + input_parsed = urlparse(test.input_url) + input_params = parse_qs(input_parsed.query, keep_blank_values=True) + # URL test - url = client._get_endpoint_url(test.input_url, test.input_app) - assert url == test.expected_url.format(v=__version__) + generated_url = client._get_endpoint_url(test.input_url, test.input_app) + + # Parse the URL + parsed_url = urlparse(generated_url) + parsed_params = parse_qs(parsed_url.query, keep_blank_values=True) + + # Check the url scheme, netloc and path are preserved + assert parsed_url.scheme == input_parsed.scheme + assert parsed_url.netloc == input_parsed.netloc + assert parsed_url.path == input_parsed.path + + # Validate `sm-app` + assert parsed_params["sm-app"] == [ + test.input_app or input_params.get("sm-app", [None])[0] or f"voice-sdk/{__version__}" + ] + + # Validate `sm-voice-sdk` + assert parsed_params["sm-voice-sdk"] == [__version__] + + # Check other original params are preserved + for key, value in input_params.items(): + if key not in ["sm-app", "sm-voice-sdk"]: + assert parsed_params[key] == value From 56e20416fed72cefed317d29573b3b8838f78794 Mon Sep 17 00:00:00 2001 From: Sam Sykes Date: Mon, 12 Jan 2026 13:18:42 +0000 Subject: [PATCH 11/12] neater rule-checking for sm-app --- tests/voice/test_16_url.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/voice/test_16_url.py b/tests/voice/test_16_url.py index 2a94baf..c41dfc9 100644 --- a/tests/voice/test_16_url.py +++ b/tests/voice/test_16_url.py @@ -73,9 +73,12 @@ async def test_url_endpoints(test: URLExample): assert parsed_url.path == input_parsed.path # Validate `sm-app` - assert parsed_params["sm-app"] == [ - test.input_app or input_params.get("sm-app", [None])[0] or f"voice-sdk/{__version__}" - ] + if test.input_app: + assert parsed_params["sm-app"] == [test.input_app] + elif "sm-app" in input_params: + assert parsed_params["sm-app"] == [input_params["sm-app"][0]] + else: + assert parsed_params["sm-app"] == [f"voice-sdk/{__version__}"] # Validate `sm-voice-sdk` assert parsed_params["sm-voice-sdk"] == [__version__] From 8d375c4131f30500478d54e0f20cbf54d0c81d69 Mon Sep 17 00:00:00 2001 From: Sam Sykes Date: Mon, 12 Jan 2026 13:24:23 +0000 Subject: [PATCH 12/12] variable name change --- sdk/voice/speechmatics/voice/_client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/voice/speechmatics/voice/_client.py b/sdk/voice/speechmatics/voice/_client.py index 70bb4f1..2e1ee43 100644 --- a/sdk/voice/speechmatics/voice/_client.py +++ b/sdk/voice/speechmatics/voice/_client.py @@ -1933,5 +1933,5 @@ def _get_endpoint_url(self, url: str, app: Optional[str] = None) -> str: params["sm-voice-sdk"] = [__version__] # Re-encode the query string and reconstruct - new_query = urlencode(params, doseq=True) - return urlunparse(parsed._replace(query=new_query)) + updated_query = urlencode(params, doseq=True) + return urlunparse(parsed._replace(query=updated_query))