From 977b030dd9a5e7a4e240d9128cf122994b79ede2 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Thu, 18 Apr 2024 20:08:13 -0700 Subject: [PATCH] ui - show all alert types when getting all callbacks --- litellm/proxy/proxy_server.py | 3 ++- litellm/proxy/utils.py | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.py index 9b18976a56..c7415dea46 100644 --- a/litellm/proxy/proxy_server.py +++ b/litellm/proxy/proxy_server.py @@ -8379,12 +8379,13 @@ async def get_config(): _slack_env_vars[_var] = _decrypted_value _alerting_types = proxy_logging_obj.alert_types - + _all_alert_types = proxy_logging_obj._all_possible_alert_types() _data_to_return.append( { "name": "slack", "variables": _slack_env_vars, "alerting_types": _alerting_types, + "all_alert_types": _all_alert_types, } ) diff --git a/litellm/proxy/utils.py b/litellm/proxy/utils.py index d724146e6b..22e95d7717 100644 --- a/litellm/proxy/utils.py +++ b/litellm/proxy/utils.py @@ -81,6 +81,17 @@ class ProxyLogging: "db_exceptions", ] + def _all_possible_alert_types(self): + # used by the UI to show all supported alert types + # Note: This is not the alerts the user has configured, instead it's all possible alert types a user can select + return [ + "llm_exceptions", + "llm_too_slow", + "llm_requests_hanging", + "budget_alerts", + "db_exceptions", + ] + def update_values( self, alerting: Optional[List],