diff --git a/litellm/integrations/litedebugger.py b/litellm/integrations/litedebugger.py index b18a42db7..d69602d5c 100644 --- a/litellm/integrations/litedebugger.py +++ b/litellm/integrations/litedebugger.py @@ -13,6 +13,8 @@ class LiteDebugger: def validate_environment(self, email): try: self.user_email = (email or os.getenv("LITELLM_TOKEN") or os.getenv("LITELLM_EMAIL")) + if self.user_email == None: # if users are trying to use_client=True but token not set + raise ValueError("litellm.use_client = True but no token or email passed. Please set it in litellm.token") self.dashboard_url = "https://admin.litellm.ai/" + self.user_email try: print( @@ -21,7 +23,7 @@ class LiteDebugger: except: print(f"Here's your LiteLLM Dashboard 👉 {self.dashboard_url}") if self.user_email == None: - raise Exception( + raise ValueError( "[Non-Blocking Error] LiteLLMDebugger: Missing LITELLM_TOKEN. Set it in your environment. Eg.: os.environ['LITELLM_TOKEN']= " ) except Exception as e: diff --git a/litellm/tests/test_completion.py b/litellm/tests/test_completion.py index 7a7c4185e..4f17eaa20 100644 --- a/litellm/tests/test_completion.py +++ b/litellm/tests/test_completion.py @@ -15,10 +15,6 @@ from litellm import embedding, completion, text_completion, completion_cost litellm.vertex_project = "pathrise-convert-1606954137718" litellm.vertex_location = "us-central1" litellm.use_client = True -# from infisical import InfisicalClient - -# litellm.set_verbose = True -# litellm.secret_manager_client = InfisicalClient(token=os.environ["INFISICAL_TOKEN"]) user_message = "Write a short poem about the sky" messages = [{"content": user_message, "role": "user"}] @@ -217,6 +213,7 @@ def test_completion_openai_prompt(): def test_completion_text_openai(): try: + # litellm.set_verbose=True response = completion(model="text-davinci-003", messages=messages) # Add any assertions here to check the response print(response) diff --git a/litellm/utils.py b/litellm/utils.py index d0a6570d5..79f65b8cf 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -1061,7 +1061,7 @@ def set_callbacks(callback_list, function_id=None): elif litellm.email: liteDebuggerClient = LiteDebugger(email=litellm.email) else: - liteDebuggerClient = LiteDebugger() + liteDebuggerClient = LiteDebugger(email=str(uuid.uuid4())) except Exception as e: raise e