mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-07 02:59:05 +00:00
fix: add None check for litellm_params
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
57ae20611b
commit
cf22e9a92b
1 changed files with 4 additions and 2 deletions
|
|
@ -34,6 +34,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:
|
||||
|
|
@ -93,11 +95,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