From 6b708347f3bb3c6f08b2d3a28cdca9d4dc0a15b2 Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Thu, 4 Jan 2024 17:00:07 +0530 Subject: [PATCH] fix(proxy_server.py): enable sending test connections when slack alerting added to proxy via ui --- litellm/proxy/proxy_server.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.py index 0dfe06db7..ffa5f1669 100644 --- a/litellm/proxy/proxy_server.py +++ b/litellm/proxy/proxy_server.py @@ -2286,7 +2286,7 @@ async def update_config(config_info: ConfigYAML): Currently supports modifying General Settings + LiteLLM settings """ - global llm_router, llm_model_list, general_settings, proxy_config + global llm_router, llm_model_list, general_settings, proxy_config, proxy_logging_obj try: # Load existing config config = await proxy_config.get_config() @@ -2323,7 +2323,14 @@ async def update_config(config_info: ConfigYAML): } # Save the updated config - config = await proxy_config.save_config(new_config=config) + await proxy_config.save_config(new_config=config) + + # Test new connections + ## Slack + if "slack" in config.get("general_settings", {}).get("alerting", []): + await proxy_logging_obj.alerting_handler( + message="This is a test", level="Low" + ) return {"message": "Config updated successfully"} except HTTPException as e: raise e