fix(utils.py): fix check for if cached response should be returned

This commit is contained in:
Krrish Dholakia 2024-01-04 21:49:19 +05:30
parent 74f6f6489a
commit aa72d65c90

View file

@ -1975,7 +1975,10 @@ def client(original_function):
if ( if (
(kwargs.get("caching", None) is None and litellm.cache is not None) (kwargs.get("caching", None) is None and litellm.cache is not None)
or kwargs.get("caching", False) == True or kwargs.get("caching", False) == True
or kwargs.get("cache", {}).get("no-cache", False) != True or (
kwargs.get("cache", None) is not None
and kwargs.get("cache", {}).get("no-cache", False) != True
)
): # allow users to control returning cached responses from the completion function ): # allow users to control returning cached responses from the completion function
# checking cache # checking cache
print_verbose(f"INSIDE CHECKING CACHE") print_verbose(f"INSIDE CHECKING CACHE")