feat(proxy_server.py): schedule slack daily report if enabled

if user enabled daily_reports, send them a slack report every 12 hours
This commit is contained in:
Krrish Dholakia 2024-05-06 18:25:48 -07:00
parent 718f423d7d
commit 6b9b4f05ba
4 changed files with 114 additions and 35 deletions

View file

@ -107,6 +107,7 @@ class ProxyLogging:
]
]
] = None,
alerting_args: Optional[dict] = None,
):
self.alerting = alerting
if alerting_threshold is not None:
@ -118,8 +119,12 @@ class ProxyLogging:
alerting=self.alerting,
alerting_threshold=self.alerting_threshold,
alert_types=self.alert_types,
alerting_args=alerting_args,
)
if "daily_reports" in self.alert_types:
litellm.callbacks.append(self.slack_alerting_instance) # type: ignore
if redis_cache is not None:
self.internal_usage_cache.redis_cache = redis_cache