Merge pull request #1601 from BerriAI/litellm_improve_slack_alertign

[Feat] Proxy - Improve Slack Alerting
This commit is contained in:
Ishaan Jaff 2024-01-24 16:43:23 -08:00 committed by GitHub
commit 45ca7343d0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 50 additions and 10 deletions

View file

@ -1899,6 +1899,8 @@ async def chat_completion(
else: # router is not set
response = await litellm.acompletion(**data)
# Post Call Processing
data["litellm_status"] = "success" # used for alerting
if hasattr(response, "_hidden_params"):
model_id = response._hidden_params.get("model_id", None) or ""
else:
@ -2084,6 +2086,7 @@ async def embeddings(
response = await litellm.aembedding(**data)
### ALERTING ###
data["litellm_status"] = "success" # used for alerting
end_time = time.time()
asyncio.create_task(
proxy_logging_obj.response_taking_too_long(
@ -2199,6 +2202,7 @@ async def image_generation(
response = await litellm.aimage_generation(**data)
### ALERTING ###
data["litellm_status"] = "success" # used for alerting
end_time = time.time()
asyncio.create_task(
proxy_logging_obj.response_taking_too_long(