diff --git a/litellm/caching.py b/litellm/caching.py index 567b9aadb..ac9d559dc 100644 --- a/litellm/caching.py +++ b/litellm/caching.py @@ -124,7 +124,9 @@ class RedisCache(BaseCache): self.redis_client.set(name=key, value=str(value), ex=ttl) except Exception as e: # NON blocking - notify users Redis is throwing an exception - print_verbose("LiteLLM Caching: set() - Got exception from REDIS : ", e) + print_verbose( + f"LiteLLM Caching: set() - Got exception from REDIS : {str(e)}" + ) async def async_set_cache(self, key, value, **kwargs): _redis_client = self.init_async_client() diff --git a/litellm/utils.py b/litellm/utils.py index 6d56d128f..0bb7bd2b3 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -2330,13 +2330,13 @@ def client(original_function): model_response_object=ModelResponse(), stream=kwargs.get("stream", False), ) - - cached_result = CustomStreamWrapper( - completion_stream=cached_result, - model=model, - custom_llm_provider="cached_response", - logging_obj=logging_obj, - ) + if kwargs.get("stream", False) == True: + cached_result = CustomStreamWrapper( + completion_stream=cached_result, + model=model, + custom_llm_provider="cached_response", + logging_obj=logging_obj, + ) elif call_type == CallTypes.embedding.value and isinstance( cached_result, dict ):