Skip to content

Commit 8f86739

Browse files
fix: add negative guard on object field in _is_chat_completion_cached_dict
Co-authored-by: Yassin Kortam <[email protected]>
1 parent 9c1eb56 commit 8f86739

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

litellm/caching/caching_handler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ def _is_chat_completion_cached_dict(cached_result: dict) -> bool:
9292
if isinstance(cached_id, str) and cached_id.startswith("chatcmpl"):
9393
return True
9494
obj = cached_result.get("object")
95-
if isinstance(obj, str) and obj.startswith("chat.completion"):
96-
return True
95+
if isinstance(obj, str):
96+
return obj.startswith("chat.completion")
9797
return "choices" in cached_result
9898

9999

0 commit comments

Comments
 (0)