code: def test_custom_redis_cache_with_key():
      messages = [{"role": "user", "content": "write a one line story"}]
      litellm.cache = Cache(
          type="redis",
          host=os.environ["REDIS_HOST"],
          port=os.environ["REDIS_PORT"],
          password=os.environ["REDIS_PASSWORD"],
      )
      litellm.cache.get_cache_key = custom_get_cache_key
  
      local_cache = {}
  
      def set_cache(key, value):
          local_cache[key] = value
  
      def get_cache(key):
          if key in local_cache:
              return local_cache[key]
  
      litellm.cache.cache.set_cache = set_cache
      litellm.cache.cache.get_cache = get_cache
  
      # patch this redis cache get and set call
  
      response1 = completion(
          model="gpt-3.5-turbo",
          messages=messages,
          temperature=1,
          caching=True,
          num_retries=3,
      )
      response2 = completion(
          model="gpt-3.5-turbo",
          messages=messages,
          temperature=1,
          caching=True,
          num_retries=3,
      )
      response3 = completion(
          model="gpt-3.5-turbo",
          messages=messages,
          temperature=1,
          caching=False,
          num_retries=3,
      )
  
      print(f"response1: {response1}")
      print(f"response2: {response2}")
      print(f"response3: {response3}")
  
      if (
          response3["choices"][0]["message"]["content"]
          == response2["choices"][0]["message"]["content"]
      ):
          pytest.fail(f"Error occurred:")
      litellm.cache = None
      litellm.success_callback = []
      litellm._async_success_callback = []
  
imports: import sys, os, uuid
  import time
  import traceback
  from dotenv import load_dotenv
  import os
  import pytest
  import litellm
  from litellm import embedding, completion
  from litellm.caching import Cache
  import random
  import hashlib
  import random
  import string
label_desc: Use image node_id 14 for calling a global function with example usage: test_custom_redis_cache_with_key() and returns: local_cache