mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
fix(caching.py): return updated kwargs from get_cache helper function
This commit is contained in:
parent
ebf1bc842c
commit
7f83cca62c
3 changed files with 9 additions and 8 deletions
|
@ -678,7 +678,7 @@ class Cache:
|
|||
if k == "ttl":
|
||||
kwargs["ttl"] = v
|
||||
cached_data = {"timestamp": time.time(), "response": result}
|
||||
return cache_key, cached_data
|
||||
return cache_key, cached_data, kwargs
|
||||
else:
|
||||
raise Exception("cache key is None")
|
||||
except Exception as e:
|
||||
|
@ -696,7 +696,7 @@ class Cache:
|
|||
None
|
||||
"""
|
||||
try:
|
||||
cache_key, cached_data = self._add_cache_logic(
|
||||
cache_key, cached_data, kwargs = self._add_cache_logic(
|
||||
result=result, *args, **kwargs
|
||||
)
|
||||
self.cache.set_cache(cache_key, cached_data, **kwargs)
|
||||
|
@ -710,7 +710,7 @@ class Cache:
|
|||
Async implementation of add_cache
|
||||
"""
|
||||
try:
|
||||
cache_key, cached_data = self._add_cache_logic(
|
||||
cache_key, cached_data, kwargs = self._add_cache_logic(
|
||||
result=result, *args, **kwargs
|
||||
)
|
||||
await self.cache.async_set_cache(cache_key, cached_data, **kwargs)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue