From f6279353ac8729fa7ccb01efaeb5075ce74123f5 Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Thu, 10 Aug 2023 13:27:59 -0700 Subject: [PATCH] fix failing tests --- litellm/tests/test_cache.py | 1 + litellm/utils.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/litellm/tests/test_cache.py b/litellm/tests/test_cache.py index db3aad6238..40be3b9a53 100644 --- a/litellm/tests/test_cache.py +++ b/litellm/tests/test_cache.py @@ -41,3 +41,4 @@ def test_completion_gpt(): pytest.fail(f"Error occurred: {e}") +litellm.cache = False # rest to False for the next test \ No newline at end of file diff --git a/litellm/utils.py b/litellm/utils.py index 58f5347b4a..f3ff858bc1 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -722,6 +722,8 @@ def message_to_user_question(messages): def add_cache(messages, model_response): global cache_collection + if cache_collection == None: + make_collection() user_question = message_to_user_question(messages) cache_collection.add( documents=[user_question],