mirror of
https://github.com/tiennm99/litellm.git
synced 2026-08-13 20:23:56 +00:00
(fix) cache control logic
This commit is contained in:
+9
-10
@@ -2814,17 +2814,16 @@ def client(original_function):
|
||||
)
|
||||
# if caching is false, don't run this
|
||||
final_embedding_cached_response = None
|
||||
|
||||
cache_controls = kwargs.get("cache", None)
|
||||
if (
|
||||
(
|
||||
kwargs.get("caching", None) is None
|
||||
and kwargs.get("cache", None) is None
|
||||
and litellm.cache is not None
|
||||
)
|
||||
or kwargs.get("caching", False) == True
|
||||
or (
|
||||
kwargs.get("cache", None) is not None
|
||||
and kwargs.get("cache").get("no-cache", False) != True
|
||||
kwargs.get("caching", None) is None
|
||||
and cache_controls is None
|
||||
and litellm.cache is not None
|
||||
) or (
|
||||
kwargs.get("caching", False) == True
|
||||
and (
|
||||
cache_controls is not None
|
||||
and cache_controls.get("no-cache", False) != True
|
||||
)
|
||||
): # allow users to control returning cached responses from the completion function
|
||||
# checking cache
|
||||
|
||||
Reference in New Issue
Block a user