fix(utils.py): use preset cache key for async calls as well

This commit is contained in:
Krrish Dholakia 2024-01-11 19:30:28 +05:30
parent f8d1720690
commit a1af7688ce

View file

@ -2241,6 +2241,10 @@ def client(original_function):
)
cached_result = await asyncio.gather(*tasks)
else:
preset_cache_key = litellm.cache.get_cache_key(*args, **kwargs)
kwargs[
"preset_cache_key"
] = preset_cache_key # for streaming calls, we need to pass the preset_cache_key
cached_result = litellm.cache.get_cache(*args, **kwargs)
if cached_result is not None and not isinstance(
cached_result, list