forked from phoenix/litellm-mirror
feat - send alert on adding new model
This commit is contained in:
parent
62adaa0fd4
commit
c600371e6e
1 changed files with 6 additions and 0 deletions
|
@ -7303,6 +7303,7 @@ async def add_new_model(
|
||||||
"""
|
"""
|
||||||
# encrypt litellm params #
|
# encrypt litellm params #
|
||||||
_litellm_params_dict = model_params.litellm_params.dict(exclude_none=True)
|
_litellm_params_dict = model_params.litellm_params.dict(exclude_none=True)
|
||||||
|
_orignal_litellm_model_name = model_params.litellm_params.model
|
||||||
for k, v in _litellm_params_dict.items():
|
for k, v in _litellm_params_dict.items():
|
||||||
if isinstance(v, str):
|
if isinstance(v, str):
|
||||||
encrypted_value = encrypt_value(value=v, master_key=master_key) # type: ignore
|
encrypted_value = encrypt_value(value=v, master_key=master_key) # type: ignore
|
||||||
|
@ -7329,6 +7330,11 @@ async def add_new_model(
|
||||||
prisma_client=prisma_client, proxy_logging_obj=proxy_logging_obj
|
prisma_client=prisma_client, proxy_logging_obj=proxy_logging_obj
|
||||||
)
|
)
|
||||||
|
|
||||||
|
await proxy_logging_obj.slack_alerting_instance.model_added_alert(
|
||||||
|
model_name=model_params.model_name,
|
||||||
|
litellm_model_name=_orignal_litellm_model_name,
|
||||||
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
status_code=500,
|
status_code=500,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue