diff --git a/litellm/caching/caching.py b/litellm/caching/caching.py index b35ea2d5db6..89208159bf0 100644 --- a/litellm/caching/caching.py +++ b/litellm/caching/caching.py @@ -94,7 +94,7 @@ def _request_message_count(kwargs: Mapping[str, object]) -> int: return sum(1 for item in items if _is_conversation_item(item)) -def _is_cache_call_type_supported(call_type: str, supported_call_types: Sequence[str] | None) -> bool: +def is_cache_call_type_supported(call_type: str, supported_call_types: Sequence[str] | None) -> bool: if supported_call_types is None: return True normalised_call_type: Final = call_type.lstrip("_") @@ -994,7 +994,7 @@ class Cache: if raw_source is not None: raw_name: Final[object] = getattr(raw_source, "value", None) or getattr(raw_source, "__name__", None) call_type_name: Final = raw_name if isinstance(raw_name, str) else str(raw_source) - if not _is_cache_call_type_supported(call_type_name, self.supported_call_types): + if not is_cache_call_type_supported(call_type_name, self.supported_call_types): return False if self.max_messages is not None and _request_message_count(kwargs) > self.max_messages: return False diff --git a/litellm/caching/caching_handler.py b/litellm/caching/caching_handler.py index 44ee31d727c..38c4b9cb391 100644 --- a/litellm/caching/caching_handler.py +++ b/litellm/caching/caching_handler.py @@ -27,7 +27,7 @@ import litellm from litellm._internal_context import is_internal_call, post_response_phase from litellm._logging import print_verbose, verbose_logger from litellm.caching import InMemoryCache -from litellm.caching.caching import S3Cache, _is_cache_call_type_supported, response_cache_phase +from litellm.caching.caching import S3Cache, is_cache_call_type_supported, response_cache_phase from litellm.constants import CACHE_WRITE_SHUTDOWN_FLUSH_TIMEOUT_SECONDS, RESPONSE_CACHE_EXCLUDED_PROVIDERS from litellm.litellm_core_utils.hidden_params import get_hidden_params from litellm.litellm_core_utils.llm_response_utils.response_metadata import ( @@ -1292,7 +1292,7 @@ class LLMCachingHandler: """ if litellm.cache is None: return False - return _is_cache_call_type_supported(original_function.__name__, litellm.cache.supported_call_types) + return is_cache_call_type_supported(original_function.__name__, litellm.cache.supported_call_types) async def add_streaming_response_to_cache(self, processed_chunk: ModelResponse) -> None: """