mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
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:
parent
718f423d7d
commit
6b9b4f05ba
4 changed files with 114 additions and 35 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue