diff --git a/litellm/integrations/litedebugger.py b/litellm/integrations/litedebugger.py index 6ae9a1d81..afd70eefb 100644 --- a/litellm/integrations/litedebugger.py +++ b/litellm/integrations/litedebugger.py @@ -2,6 +2,7 @@ import requests, traceback, json, os class LiteDebugger: user_email = None + dashboard_url = None def __init__(self): self.api_url = "https://api.litellm.ai/debugger" self.validate_environment() @@ -10,7 +11,8 @@ class LiteDebugger: def validate_environment(self): try: self.user_email = os.getenv("LITELLM_EMAIL") - print(f"Here's your free Dashboard 👉 {'https://admin.litellm.ai/' + self.user_email}") + self.dashboard_url = 'https://admin.litellm.ai/' + self.user_email + print(f"Here's your free Dashboard 👉 {self.dashboard_url}") if self.user_email == None: raise Exception("[Non-Blocking Error] LiteLLMDebugger: Missing LITELLM_EMAIL. Set it in your environment. Eg.: os.environ['LITELLM_EMAIL']= ") except Exception as e: diff --git a/litellm/utils.py b/litellm/utils.py index e47b55978..93a637270 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -280,6 +280,7 @@ def exception_logging( ####### CLIENT ################### # make it easy to log if completion/embedding runs succeeded or failed + see what happened | Non-Blocking def client(original_function): + global liteDebuggerClient def function_setup( *args, **kwargs ): # just run once to check if user wants to send their data anywhere - PostHog/Sentry/Slack/etc. @@ -410,6 +411,9 @@ def client(original_function): args=(e, traceback_exception, start_time, end_time, args, kwargs), ) # don't interrupt execution of main thread my_thread.start() + if hasattr(e, "message"): + if liteDebuggerClient and liteDebuggerClient.dashboard_url != None: # make it easy to get to the debugger logs if you've initialized it + e.message += f"\n Check the log in your dashboard - {liteDebuggerClient.dashboard_url}" raise e return wrapper @@ -1027,7 +1031,7 @@ def modify_integration(integration_name, integration_params): def exception_type(model, original_exception, custom_llm_provider): - global user_logger_fn + global user_logger_fn, liteDebuggerClient exception_mapping_worked = False try: if isinstance(original_exception, OriginalError): diff --git a/pyproject.toml b/pyproject.toml index 5d45dcec3..0824db266 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "litellm" -version = "0.1.439" +version = "0.1.440" description = "Library to easily interface with LLM API providers" authors = ["BerriAI"] license = "MIT License"