mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-24 18:24:20 +00:00
fix(router.py): use an older version of async for compatibility
This commit is contained in:
parent
39072bd196
commit
02464f6661
1 changed files with 1 additions and 3 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue