fixing lite debugger error

This commit is contained in:
Krrish Dholakia 2023-08-22 15:15:46 -07:00
parent 986925fafa
commit f980c8450d
4 changed files with 18 additions and 18 deletions

View file

@ -1,22 +1,22 @@
# #### What this tests #### #### What this tests ####
# # This tests if logging to the litedebugger integration actually works # This tests if logging to the litedebugger integration actually works
# # pytest mistakes intentional bad calls as failed tests -> [TODO] fix this # pytest mistakes intentional bad calls as failed tests -> [TODO] fix this
# import sys, os import sys, os
# import traceback import traceback
# import pytest import pytest
# sys.path.insert(0, os.path.abspath('../..')) # Adds the parent directory to the system path sys.path.insert(0, os.path.abspath('../..')) # Adds the parent directory to the system path
# import litellm import litellm
# from litellm import embedding, completion from litellm import embedding, completion
# litellm.debugger = True litellm.email = "krrish@berri.ai"
# user_message = "Hello, how are you?" user_message = "Hello, how are you?"
# messages = [{ "content": user_message,"role": "user"}] messages = [{ "content": user_message,"role": "user"}]
# #openai call #openai call
# response = completion(model="gpt-3.5-turbo", messages=[{"role": "user", "content": "Hi 👋 - i'm openai"}]) response = completion(model="gpt-3.5-turbo", messages=[{"role": "user", "content": "Hi 👋 - i'm openai"}])
# #bad request call #bad request call
# response = completion(model="chatgpt-test", messages=[{"role": "user", "content": "Hi 👋 - i'm a bad request"}]) response = completion(model="chatgpt-test", messages=[{"role": "user", "content": "Hi 👋 - i'm a bad request"}])

View file

@ -288,7 +288,7 @@ def client(original_function):
): # just run once to check if user wants to send their data anywhere - PostHog/Sentry/Slack/etc. ): # just run once to check if user wants to send their data anywhere - PostHog/Sentry/Slack/etc.
try: try:
global callback_list, add_breadcrumb, user_logger_fn global callback_list, add_breadcrumb, user_logger_fn
if litellm.debugger or os.getenv("LITELLM_EMAIL", None) != None: # add to input, success and failure callbacks if user sets debugging to true if litellm.email or os.getenv("LITELLM_EMAIL", None) != None: # add to input, success and failure callbacks if user sets debugging to true
litellm.input_callback.append("lite_debugger") litellm.input_callback.append("lite_debugger")
litellm.success_callback.append("lite_debugger") litellm.success_callback.append("lite_debugger")
litellm.failure_callback.append("lite_debugger") litellm.failure_callback.append("lite_debugger")

View file

@ -1,6 +1,6 @@
[tool.poetry] [tool.poetry]
name = "litellm" name = "litellm"
version = "0.1.451" version = "0.1.452"
description = "Library to easily interface with LLM API providers" description = "Library to easily interface with LLM API providers"
authors = ["BerriAI"] authors = ["BerriAI"]
license = "MIT License" license = "MIT License"