From 32f3e032e97beabf17b5595a72972eccce7b2640 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Tue, 7 May 2024 15:10:47 -0700 Subject: [PATCH] feat - send slack alerts litellm.router --- litellm/integrations/slack_alerting.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/litellm/integrations/slack_alerting.py b/litellm/integrations/slack_alerting.py index 5546f7c33..b6e2f7ba5 100644 --- a/litellm/integrations/slack_alerting.py +++ b/litellm/integrations/slack_alerting.py @@ -796,6 +796,14 @@ Model Info: updated_at=litellm.utils.get_utc_datetime(), ) ) + if "llm_exceptions" in self.alert_types: + original_exception = kwargs.get("exception", None) + + await self.send_alert( + message="LLM API Failure - " + str(original_exception), + level="High", + alert_type="llm_exceptions", + ) async def _run_scheduler_helper(self, llm_router: litellm.Router) -> bool: """