From a38d3b17c5bb499f073ce162b879dfb8fdce3327 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Sat, 6 Apr 2024 19:16:27 -0700 Subject: [PATCH] ci/cd run async handler --- litellm/llms/anthropic.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/litellm/llms/anthropic.py b/litellm/llms/anthropic.py index 3eca11beff..d836ed8db5 100644 --- a/litellm/llms/anthropic.py +++ b/litellm/llms/anthropic.py @@ -105,9 +105,6 @@ def validate_environment(api_key, user_headers): class AnthropicChatCompletion(BaseLLM): def __init__(self) -> None: super().__init__() - self.async_handler = AsyncHTTPHandler( - timeout=httpx.Timeout(timeout=600.0, connect=5.0) - ) def process_response( self, @@ -258,6 +255,9 @@ class AnthropicChatCompletion(BaseLLM): logger_fn=None, headers={}, ): + self.async_handler = AsyncHTTPHandler( + timeout=httpx.Timeout(timeout=600.0, connect=5.0) + ) response = await self.async_handler.post( api_base, headers=headers, data=json.dumps(data) ) @@ -296,6 +296,9 @@ class AnthropicChatCompletion(BaseLLM): logger_fn=None, headers={}, ): + self.async_handler = AsyncHTTPHandler( + timeout=httpx.Timeout(timeout=600.0, connect=5.0) + ) response = await self.async_handler.post( api_base, headers=headers, data=json.dumps(data) )