From f6d7d0e5207877736fef300a898f59ee17305ec9 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Fri, 24 May 2024 18:31:10 -0700 Subject: [PATCH] fix - update webhook event validation --- litellm/integrations/slack_alerting.py | 3 +++ litellm/proxy/_types.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/litellm/integrations/slack_alerting.py b/litellm/integrations/slack_alerting.py index aeb1b369fc1..3608d12daf0 100644 --- a/litellm/integrations/slack_alerting.py +++ b/litellm/integrations/slack_alerting.py @@ -655,6 +655,9 @@ class SlackAlerting(CustomLogger): _id = user_info.token # percent of max_budget left to spend + if user_info.max_budget is None: + return + if user_info.max_budget > 0: percent_left = ( user_info.max_budget - user_info.spend diff --git a/litellm/proxy/_types.py b/litellm/proxy/_types.py index 0d52ad0ecef..e43522e7d16 100644 --- a/litellm/proxy/_types.py +++ b/litellm/proxy/_types.py @@ -1093,7 +1093,7 @@ class CallInfo(LiteLLMBase): """Used for slack budget alerting""" spend: float - max_budget: float + max_budget: Optional[float] = None token: str = Field(description="Hashed value of that key") user_id: Optional[str] = None team_id: Optional[str] = None