From 02464f6661bf788e6ccc10908546e179da9dda20 Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Thu, 23 Nov 2023 21:00:53 -0800 Subject: [PATCH] fix(router.py): use an older version of async for compatibility --- litellm/router.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/litellm/router.py b/litellm/router.py index 8b7370169a..da39b4d476 100644 --- a/litellm/router.py +++ b/litellm/router.py @@ -182,9 +182,7 @@ class Router: kwargs["original_function"] = self._acompletion kwargs["num_retries"] = self.num_retries kwargs.setdefault("metadata", {}).update({"model_group": model}) - # Use asyncio.timeout to enforce the timeout - async with asyncio.timeout(self.timeout): # type: ignore - response = await self.async_function_with_fallbacks(**kwargs) + response = await asyncio.wait_for(self.async_function_with_fallbacks(**kwargs), timeout=self.timeout) return response except Exception as e: