mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 11:14:04 +00:00
fix(utils.py): use preset cache key for async calls as well
This commit is contained in:
parent
f8d1720690
commit
a1af7688ce
1 changed files with 4 additions and 0 deletions
|
@ -2241,6 +2241,10 @@ def client(original_function):
|
||||||
)
|
)
|
||||||
cached_result = await asyncio.gather(*tasks)
|
cached_result = await asyncio.gather(*tasks)
|
||||||
else:
|
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)
|
cached_result = litellm.cache.get_cache(*args, **kwargs)
|
||||||
if cached_result is not None and not isinstance(
|
if cached_result is not None and not isinstance(
|
||||||
cached_result, list
|
cached_result, list
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue