From 04ec3637888b4d11350c406e64ae651689118ff9 Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Fri, 8 Dec 2023 19:14:46 -0800 Subject: [PATCH] (test) redis cache --- litellm/caching.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/litellm/caching.py b/litellm/caching.py index dc4c339f27b..c79f667dfa6 100644 --- a/litellm/caching.py +++ b/litellm/caching.py @@ -91,6 +91,7 @@ class RedisCache(BaseCache): def set_cache(self, key, value, **kwargs): ttl = kwargs.get("ttl", None) + print_verbose(f"Set Redis Cache: key: {key}\nValue {value}") try: self.redis_client.set(name=key, value=str(value), ex=ttl) except Exception as e: @@ -99,8 +100,9 @@ class RedisCache(BaseCache): def get_cache(self, key, **kwargs): try: - # TODO convert this to a ModelResponse object + print_verbose(f"Get Redis Cache: key: {key}") cached_response = self.redis_client.get(key) + print_verbose(f"Got Redis Cache: key: {key}, cached_response {cached_response}") if cached_response != None: # cached_response is in `b{} convert it to ModelResponse cached_response = cached_response.decode("utf-8") # Convert bytes to string