code: def get_redis_url_from_environment():
      if "REDIS_URL" in os.environ:
          return os.environ["REDIS_URL"]
  
      if (
          "REDIS_HOST" not in os.environ
          or "REDIS_PORT" not in os.environ
      ):
          raise ValueError(
              "Either 'REDIS_URL' or both 'REDIS_HOST' and 'REDIS_PORT' must be specified for Redis."
          )
  
      if "REDIS_PASSWORD" in os.environ:
          redis_password = f":{os.environ['REDIS_PASSWORD']}@"
      else:
          redis_password = ""
  
      return f"redis://{redis_password}{os.environ['REDIS_HOST']}:{os.environ['REDIS_PORT']}"
  
file_path: litellm/litellm/_redis.py
imports: import os
  import inspect
  import redis, litellm
  from typing import List, Optional
label_desc: Use image node_id 4 for calling a global function with example usage: get_redis_url_from_environment() and returns: str, redis_password, os, str, os, os