mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-11 22:51:28 +00:00
fix: add None check for litellm_params (#16754)
We currently cover the first case where the `litellm_params` may not be there, but not when it could be None
This commit is contained in:
parent
b9bc903536
commit
6b7035e32f
1 changed files with 4 additions and 2 deletions
|
|
@ -33,6 +33,8 @@ class LowestTPMLoggingHandler(CustomLogger):
|
|||
"""
|
||||
Update TPM/RPM usage on success
|
||||
"""
|
||||
if "litellm_params" not in kwargs or kwargs["litellm_params"] is None:
|
||||
return
|
||||
if kwargs["litellm_params"].get("metadata") is None:
|
||||
pass
|
||||
else:
|
||||
|
|
@ -92,11 +94,11 @@ class LowestTPMLoggingHandler(CustomLogger):
|
|||
"""
|
||||
Update TPM/RPM usage on success
|
||||
"""
|
||||
if "litellm_params" not in kwargs or kwargs["litellm_params"] is None:
|
||||
return
|
||||
if kwargs["litellm_params"].get("metadata") is None:
|
||||
pass
|
||||
else:
|
||||
if "litellm_params" not in kwargs:
|
||||
return
|
||||
model_group = kwargs["litellm_params"]["metadata"].get(
|
||||
"model_group", None
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue