mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
fix:completion fails when client=True&no email set
This commit is contained in:
parent
7b795fcd64
commit
b0a2e57a8a
3 changed files with 5 additions and 6 deletions
|
@ -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']= <your_email>"
|
||||
)
|
||||
except Exception as e:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue