MCPcopy Create free account
hub / github.com/BerriAI/litellm / get_cache

Method get_cache

litellm/caching/in_memory_cache.py:207–217  ·  view source on GitHub ↗
(self, key, **kwargs)

Source from the content-addressed store, hash-verified

205 return False
206
207 def get_cache(self, key, **kwargs):
208 if key in self.cache_dict:
209 if self.evict_element_if_expired(key):
210 return None
211 original_cached_response = self.cache_dict[key]
212 try:
213 cached_response = json.loads(original_cached_response)
214 except Exception:
215 cached_response = original_cached_response
216 return cached_response
217 return None
218
219 def batch_get_cache(self, keys: list, **kwargs):
220 return_val = []

Calls 1