From d4dc8e60b6d15f94470c9e6178d0e017211adc50 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Thu, 21 Nov 2024 10:27:08 -0800 Subject: [PATCH] fix make_async_azure_httpx_request --- .circleci/config.yml | 1 + litellm/llms/AzureOpenAI/azure.py | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b0a369a35..db7c4ef5b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -771,6 +771,7 @@ jobs: - run: python ./tests/code_coverage_tests/litellm_logging_code_coverage.py - run: python ./tests/documentation_tests/test_env_keys.py - run: python ./tests/documentation_tests/test_api_docs.py + - run: python ./tests/code_coverage_tests/ensure_async_clients_test.py - run: helm lint ./deploy/charts/litellm-helm db_migration_disable_update_check: diff --git a/litellm/llms/AzureOpenAI/azure.py b/litellm/llms/AzureOpenAI/azure.py index 39dea14e2..f6a1790b6 100644 --- a/litellm/llms/AzureOpenAI/azure.py +++ b/litellm/llms/AzureOpenAI/azure.py @@ -12,7 +12,11 @@ from typing_extensions import overload import litellm from litellm.caching.caching import DualCache from litellm.litellm_core_utils.litellm_logging import Logging as LiteLLMLoggingObj -from litellm.llms.custom_httpx.http_handler import AsyncHTTPHandler, HTTPHandler +from litellm.llms.custom_httpx.http_handler import ( + AsyncHTTPHandler, + HTTPHandler, + get_async_httpx_client, +) from litellm.types.utils import EmbeddingResponse from litellm.utils import ( CustomStreamWrapper, @@ -977,7 +981,10 @@ class AzureChatCompletion(BaseLLM): else: _params["timeout"] = httpx.Timeout(timeout=600.0, connect=5.0) - async_handler = AsyncHTTPHandler(**_params) # type: ignore + async_handler = get_async_httpx_client( + llm_provider=litellm.LlmProviders.AZURE, + params=_params, + ) else: async_handler = client # type: ignore