The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
feat: added alert type to alert messate to slack for easier handling on slack side.
Marcelo Mendoza793c96687339
diff --git a/litellm/integrations/SlackAlerting/slack_alerting.py b/litellm/integrations/SlackAlerting/slack_alerting.pyindex 41db4a551bd..0953fb768cb 100644--- a/litellm/integrations/SlackAlerting/slack_alerting.py+++ b/litellm/integrations/SlackAlerting/slack_alerting.py@@ -805,9 +805,9 @@ class SlackAlerting(CustomBatchLogger):### UNIQUE CACHE KEY ###cache_key = provider + region_name- outage_value: Optional[ProviderRegionOutageModel] = (- await self.internal_usage_cache.async_get_cache(key=cache_key)- )+ outage_value: Optional[+ ProviderRegionOutageModel+ ] = await self.internal_usage_cache.async_get_cache(key=cache_key)if (getattr(exception, "status_code", None) is None@@ -1367,12 +1367,11 @@ Model Info:# Get the current timestampcurrent_time = datetime.now().strftime("%H:%M:%S")_proxy_base_url = os.getenv("PROXY_BASE_URL", None)+ alert_type_formatted = f"Alert type: `{alert_type}`\n"if alert_type == "daily_reports" or alert_type == "new_model_added":- formatted_message = message+ formatted_message = alert_type_formatted + messageelse:- formatted_message = (- f"Level: `{level}`\nTimestamp: `{current_time}`\n\nMessage: {message}"- )+ formatted_message = f"{alert_type_formatted}\n Level: `{level}`\nTimestamp: `{current_time}`\n\nMessage: {message}"if kwargs:for key, value in kwargs.items():@@ -1388,9 +1387,9 @@ Model Info:self.alert_to_webhook_url is not Noneand alert_type in self.alert_to_webhook_url):- slack_webhook_url: Optional[Union[str, List[str]]] = (- self.alert_to_webhook_url[alert_type]- )+ slack_webhook_url: Optional[+ Union[str, List[str]]+ ] = self.alert_to_webhook_url[alert_type]elif self.default_webhook_url is not None:slack_webhook_url = self.default_webhook_urlelse: