From 93e897da4873c4124ca464e22bebdc3ef8318505 Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Sat, 26 Aug 2023 15:43:00 -0700 Subject: [PATCH] failing gpt cache test --- litellm/tests/data_map.txt | Bin 0 -> 575 bytes litellm/tests/test_caching.py | 23 ++++++++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 litellm/tests/data_map.txt diff --git a/litellm/tests/data_map.txt b/litellm/tests/data_map.txt new file mode 100644 index 0000000000000000000000000000000000000000..277c06bd8bf8fee06a01f7e37755a4d24076c5d5 GIT binary patch literal 575 zcmYL{!D|#T6vj)HcIhe=guVLgWh=;>JX>UYDb*I%dLA;Fx0_%lZ%kfnry%ITlK~Hn z|D%6~$!yn#xx8);(-)WArl#&;^h7E)1uVrF1`AZzNO>%q#lL3 zZUu``d2y`>w9lUs!ouR}5@-cRGaA#K0HkBJA78F}9-XUBSg}S|c`1x=qfONak16iG zv;G?0L$5ut5#rmAxm}l}I zGPg&NWEpR`9FTc*dNq`-4!#8R1^pzcL-jm^%nC?|&$dy?;GEA5)A?>Z+=`vJ8MP08 qALX6fpzE4kn=^=0NyeZozWE_cFN=!psg_*wS(Z>Q)a)XJruqlMZ`Bh3 literal 0 HcmV?d00001 diff --git a/litellm/tests/test_caching.py b/litellm/tests/test_caching.py index 8365937f6f..3f6618c339 100644 --- a/litellm/tests/test_caching.py +++ b/litellm/tests/test_caching.py @@ -45,4 +45,25 @@ def test_caching_with_models(): # if models are different, it should not return cached response print(f"response2: {response2}") print(f"response3: {response3}") - pytest.fail(f"Error occurred: {e}") + pytest.fail(f"Error occurred:") + + +# def test_gpt_cache(): +# # INIT GPT Cache # +# from gptcache import cache +# cache.init() +# cache.set_openai_key() + +# messages = [{"role": "user", "content": "what is litellm this morning? "}] +# response2 = litellm.cache.completion(model="gpt-3.5-turbo", messages=messages) +# response3 = litellm.cache.completion(model="command-nightly", messages=messages) +# print(f"response2: {response2}") +# print(f"response3: {response3}") + +# if response3 != response2: +# # if models are different, it should not return cached response +# print(f"response2: {response2}") +# print(f"response3: {response3}") +# pytest.fail(f"Error occurred:") + +# test_gpt_cache()