litellm-enterprise 0.1.30__py3-none-any.whl → 0.1.31__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -245,15 +245,25 @@ class BaseEmailLogger(CustomLogger):
245
245
  )
246
246
  return
247
247
 
248
+ # Validate that we have at least one valid email address
249
+ first_recipient_email = recipient_emails[0]
250
+ if not first_recipient_email or not first_recipient_email.strip():
251
+ verbose_proxy_logger.warning(
252
+ f"Invalid recipient email found for team soft budget alert. event={event.model_dump(exclude_none=True)}"
253
+ )
254
+ return
255
+
248
256
  verbose_proxy_logger.debug(
249
257
  f"send_team_soft_budget_alert_email_event: {json.dumps(event.model_dump(exclude_none=True), indent=4, default=str)}"
250
258
  )
251
259
 
252
260
  # Get email params using the first recipient email (for template formatting)
261
+ # For team alerts with alert_emails, we don't need user_id lookup since we already have email addresses
262
+ # Pass user_id=None to prevent _get_email_params from trying to look up email from a potentially None user_id
253
263
  email_params = await self._get_email_params(
254
264
  email_event=EmailEvent.soft_budget_crossed,
255
- user_id=event.user_id,
256
- user_email=recipient_emails[0],
265
+ user_id=None, # Team alerts don't require user_id when alert_emails are provided
266
+ user_email=first_recipient_email,
257
267
  event_message=event.event_message,
258
268
  )
259
269
 
@@ -361,6 +371,13 @@ class BaseEmailLogger(CustomLogger):
361
371
  if user_info.event_group == Litellm_EntityType.TEAM:
362
372
  if user_info.soft_budget is None:
363
373
  return
374
+ # For team soft budget alerts, require alert_emails to be configured
375
+ # Team soft budget alerts are sent via metadata.soft_budget_alerting_emails
376
+ if user_info.alert_emails is None or len(user_info.alert_emails) == 0:
377
+ verbose_proxy_logger.debug(
378
+ "Skipping team soft budget email alert: no alert_emails configured",
379
+ )
380
+ return
364
381
  else:
365
382
  # For non-team alerts, require either max_budget or soft_budget
366
383
  if user_info.max_budget is None and user_info.soft_budget is None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: litellm-enterprise
3
- Version: 0.1.30
3
+ Version: 0.1.31
4
4
  Summary: Package for LiteLLM Enterprise features
5
5
  License-File: LICENSE.md
6
6
  Author: BerriAI
@@ -99,7 +99,7 @@ litellm_enterprise/enterprise_callbacks/secrets_plugins/typeform_api_token.py,sh
99
99
  litellm_enterprise/enterprise_callbacks/secrets_plugins/vault.py,sha256=fqtHTQTC6QaNMIZpuvntBnCSAgAhY2Ka-XOz4ZLafGk,653
100
100
  litellm_enterprise/enterprise_callbacks/secrets_plugins/yandex.py,sha256=BVtFVzCTtpAkRJVudeZIEBBz1W8wueDzpu6TBvxngxo,1183
101
101
  litellm_enterprise/enterprise_callbacks/secrets_plugins/zendesk_secret_key.py,sha256=3E21lWz12WUAmdnKDZH8znfTp6hRJbE3yImtfEP52qE,613
102
- litellm_enterprise/enterprise_callbacks/send_emails/base_email.py,sha256=3nntD4U1StM75rNevkgwDxLMxtsVFk6G_IgLDRCUCuc,30115
102
+ litellm_enterprise/enterprise_callbacks/send_emails/base_email.py,sha256=FxzfgCAqVQFF6awdvqhCApo8_KI2c8mkUEq0N0GeU18,31249
103
103
  litellm_enterprise/enterprise_callbacks/send_emails/endpoints.py,sha256=hOEpM_q8MJAXlKMOtC9KbgvDVr_YFtF3reu9bjXkpsI,7017
104
104
  litellm_enterprise/enterprise_callbacks/send_emails/resend_email.py,sha256=KxNfvONZxSWbNg0HmWwfC0rvHzpN7MBJXAPKGLcy_tU,1541
105
105
  litellm_enterprise/enterprise_callbacks/send_emails/sendgrid_email.py,sha256=4bvSOfV-WzCGIJX2V32Ug91I8GBQAmypDDp40qsZbQU,2318
@@ -127,7 +127,7 @@ litellm_enterprise/proxy/vector_stores/endpoints.py,sha256=3F5A9kdttA72PGzVP3aR2
127
127
  litellm_enterprise/types/enterprise_callbacks/send_emails.py,sha256=AouBXqb1EB1-Mg3fM_3UjUDihIA45zIjRgA6M4vQ7Zw,2150
128
128
  litellm_enterprise/types/proxy/audit_logging_endpoints.py,sha256=oSJVAuRD9r6ZjRCqNBFM-J5HSgOltsXts400b2aynRE,894
129
129
  litellm_enterprise/types/proxy/proxy_server.py,sha256=kdhtxsU2uok6-XO_ebugCv7PzYYmGgv4vh-XemHJnpM,146
130
- litellm_enterprise-0.1.30.dist-info/METADATA,sha256=nq8Y1I3mSEf8m4VnGeWnkul6dKo5iRg97QYV14noVU0,1441
131
- litellm_enterprise-0.1.30.dist-info/WHEEL,sha256=kJCRJT_g0adfAJzTx2GUMmS80rTJIVHRCfG0DQgLq3o,88
132
- litellm_enterprise-0.1.30.dist-info/licenses/LICENSE.md,sha256=nq3D9ZqOvRDT6hLkypQFTc3XsE15kbkg5rkkLJVSqKY,2251
133
- litellm_enterprise-0.1.30.dist-info/RECORD,,
130
+ litellm_enterprise-0.1.31.dist-info/METADATA,sha256=xjvoQ91r8V-Ouf65UY4OUOVCEuosNnXQS0S6rfC8dek,1441
131
+ litellm_enterprise-0.1.31.dist-info/WHEEL,sha256=kJCRJT_g0adfAJzTx2GUMmS80rTJIVHRCfG0DQgLq3o,88
132
+ litellm_enterprise-0.1.31.dist-info/licenses/LICENSE.md,sha256=nq3D9ZqOvRDT6hLkypQFTc3XsE15kbkg5rkkLJVSqKY,2251
133
+ litellm_enterprise-0.1.31.dist-info/RECORD,,