docstr: Adds a result to the cache.
  
  Args:
      *args: args to litellm.completion() or embedding()
      **kwargs: kwargs to litellm.completion() or embedding()
  
  Returns:
      None
docstr_tok: ["Adds","a","result","to","the","cache",".","Args",":","*","args",":","args","to","litellm.completion","(",")","or","embedding","(",")","*","*","kwargs",":","kwargs","to","litellm.completion","(",")","or","embedding","(",")","Returns",":","None"]
code: def add_cache(self, result, *args, **kwargs):
      """
      Adds a result to the cache.
  
      Args:
          *args: args to litellm.completion() or embedding()
          **kwargs: kwargs to litellm.completion() or embedding()
  
      Returns:
          None
      """
      try:
          if "cache_key" in kwargs:
              cache_key = kwargs["cache_key"]
          else:
              cache_key = self.get_cache_key(*args, **kwargs)
          if cache_key is not None:
              if isinstance(result, OpenAIObject):
                  result = result.model_dump_json()
  
              ## Get Cache-Controls ##
              if kwargs.get("cache", None) is not None and isinstance(
                  kwargs.get("cache"), dict
              ):
                  for k, v in kwargs.get("cache").items():
                      if k == "ttl":
                          kwargs["ttl"] = v
              cached_data = {
                  "timestamp": time.time(),
                  "response": result,
              }
              self.cache.set_cache(cache_key, cached_data, **kwargs)
      except Exception as e:
          print_verbose(f"LiteLLM Cache: Excepton add_cache: {str(e)}")
          traceback.print_exc()
          pass
  
imports: import litellm
  import time, logging
  import json, traceback, ast, hashlib
  from typing import Optional, Literal, List, Union, Any
  from openai._models import BaseModel
label_desc: Use image node_id 5 for calling the Cache obj's underlying member method code with example usage: obj.add_cache(result) without return types