From 2463b08e4b90e41d07ba662bcb69cddf5edd7405 Mon Sep 17 00:00:00 2001 From: mateo-berri <277851410+mateo-berri@users.noreply.github.com> Date: Thu, 29 Oct 2026 12:58:14 -0700 Subject: [PATCH] fix(azure): pass a caller's zero timeout to the Azure audio client --- litellm/llms/azure/common_utils.py | 2 +- tests/unit/llms/azure/test_azure_common_utils.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/litellm/llms/azure/common_utils.py b/litellm/llms/azure/common_utils.py index 83eeb2f15d1..97d0e719198 100644 --- a/litellm/llms/azure/common_utils.py +++ b/litellm/llms/azure/common_utils.py @@ -61,7 +61,7 @@ class _AzureClientLimits(TypedDict, total=False): _AZURE_CLIENT_LIMITS_ADAPTER: Final = TypeAdapter(_AzureClientLimits) _AZURE_CLIENT_MAX_RETRIES_ADAPTER: Final = TypeAdapter(NonNegativeInt) -_AZURE_CLIENT_TIMEOUT_ADAPTER: Final = TypeAdapter(Annotated[float, Field(gt=0, allow_inf_nan=False)]) +_AZURE_CLIENT_TIMEOUT_ADAPTER: Final = TypeAdapter(Annotated[float, Field(ge=0, allow_inf_nan=False)]) def _azure_client_max_retries(configured: object) -> int: diff --git a/tests/unit/llms/azure/test_azure_common_utils.py b/tests/unit/llms/azure/test_azure_common_utils.py index 4a09faa944d..3b1f632f92f 100644 --- a/tests/unit/llms/azure/test_azure_common_utils.py +++ b/tests/unit/llms/azure/test_azure_common_utils.py @@ -601,6 +601,7 @@ async def test_azure_transcription_reads_max_retries_as_a_non_negative_number_an [ pytest.param("abc", id="non-numeric"), pytest.param([1, 2], id="list"), + pytest.param(-1, id="negative"), pytest.param("1" * 400, id="not-finite"), ], ) @@ -638,6 +639,7 @@ async def test_azure_speech_with_an_unusable_timeout_keeps_the_sdk_default( pytest.param(None, None, DEFAULT_TIMEOUT.read, id="nothing-set-keeps-sdk-default"), pytest.param(None, 30.0, 30.0, id="configured-request-timeout"), pytest.param(0.5, None, 0.5, id="caller-timeout"), + pytest.param(0, None, 0, id="zero-caller-timeout"), ], ) def test_azure_speech_timeout_follows_caller_then_configured_setting_then_sdk_default(