fix(caching): retain explicit cache guard for async reads

This commit is contained in:
Yusuf Efe 2026-09-14 16:27:34 +03:00
parent 62a81d4205
commit 63fbd57f61

View file

@ -208,10 +208,8 @@ class LLMCachingHandler:
"""
# Check if caching should be performed BEFORE doing expensive operations
if (
(
(kwargs.get("caching", None) is None and litellm.cache is not None)
or kwargs.get("caching", False) is True
)
litellm.cache is not None
and (kwargs.get("caching", None) is None or kwargs.get("caching", False) is True)
and (kwargs.get("cache", {}).get("no-cache", False) is not True)
and self._is_call_type_supported_by_cache(
original_function=original_function, call_type=call_type, kwargs=kwargs