From 933cc235c3d3464f5c9bfe53334b7bb85b78b0ca Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Fri, 27 Oct 2023 16:23:48 -0700 Subject: [PATCH] (test) sentry callback --- litellm/tests/test_sentry.py | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 litellm/tests/test_sentry.py diff --git a/litellm/tests/test_sentry.py b/litellm/tests/test_sentry.py new file mode 100644 index 00000000000..741cbae1161 --- /dev/null +++ b/litellm/tests/test_sentry.py @@ -0,0 +1,36 @@ +import sys +import os +import io + +sys.path.insert(0, os.path.abspath('../..')) + +from litellm import completion +import litellm + +litellm.failure_callback = ["sentry"] + +import time + +def test_exception_tracking(): + litellm.set_verbose=True + os.environ["OPENAI_API_KEY"] = "ss" + try: + response = completion(model="gpt-3.5-turbo", + messages=[{ + "role": "user", + "content": "Hi 👋 - i'm claude" + }], + max_tokens=10, + temperature=0.2 + ) + print(response) + except Exception as e: + print("got_exception") + print(e) + +test_exception_tracking() + + + + +