forked from phoenix/litellm-mirror
Merge branch 'main' into litellm_slack_daily_reports
This commit is contained in:
commit
aa62d891a0
32 changed files with 346 additions and 73 deletions
|
@ -7914,6 +7914,11 @@ def exception_type(
|
|||
if _vertex_location is not None:
|
||||
extra_information += f"\nvertex_location: {_vertex_location}\n"
|
||||
|
||||
# on litellm proxy add key name + team to exceptions
|
||||
extra_information = _add_key_name_and_team_to_alert(
|
||||
request_info=extra_information, metadata=_metadata
|
||||
)
|
||||
|
||||
################################################################################
|
||||
# End of Common Extra information Needed for all providers
|
||||
################################################################################
|
||||
|
@ -11510,3 +11515,25 @@ def _get_base_model_from_metadata(model_call_details=None):
|
|||
if base_model is not None:
|
||||
return base_model
|
||||
return None
|
||||
|
||||
|
||||
def _add_key_name_and_team_to_alert(request_info: str, metadata: dict) -> str:
|
||||
"""
|
||||
Internal helper function for litellm proxy
|
||||
Add the Key Name + Team Name to the error
|
||||
Only gets added if the metadata contains the user_api_key_alias and user_api_key_team_alias
|
||||
|
||||
[Non-Blocking helper function]
|
||||
"""
|
||||
try:
|
||||
_api_key_name = metadata.get("user_api_key_alias", None)
|
||||
_user_api_key_team_alias = metadata.get("user_api_key_team_alias", None)
|
||||
if _api_key_name is not None:
|
||||
request_info = (
|
||||
f"\n\nKey Name: `{_api_key_name}`\nTeam: `{_user_api_key_team_alias}`"
|
||||
+ request_info
|
||||
)
|
||||
|
||||
return request_info
|
||||
except:
|
||||
return request_info
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue