From 3f146b2c7e2c094458342ba52b3d0943f2df8be4 Mon Sep 17 00:00:00 2001 From: Rahul Kataria Date: Sun, 12 May 2024 16:37:50 +0530 Subject: [PATCH] [Reset Code] --- litellm/caching.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/litellm/caching.py b/litellm/caching.py index 258d7b18b2..466f4d1863 100644 --- a/litellm/caching.py +++ b/litellm/caching.py @@ -374,11 +374,10 @@ class RedisCache(BaseCache): f"Set ASYNC Redis Cache PIPELINE: key: {cache_key}\nValue {cache_value}\nttl={ttl}" ) # Set the value with a TTL if it's provided. - json_cache_value = json.dumps(cache_value) if ttl is not None: - pipe.setex(cache_key, ttl, json_cache_value) + pipe.setex(cache_key, ttl, json.dumps(cache_value)) else: - pipe.set(cache_key, json_cache_value) + pipe.set(cache_key, json.dumps(cache_value)) # Execute the pipeline and return the results. results = await pipe.execute()