mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +00:00
Merge pull request #1601 from BerriAI/litellm_improve_slack_alertign
[Feat] Proxy - Improve Slack Alerting
This commit is contained in:
commit
45ca7343d0
4 changed files with 50 additions and 10 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue