Skip to content

Commit

Permalink
fix when user_api_key_dict is None
Browse files Browse the repository at this point in the history
  • Loading branch information
ishaan-jaff committed Jun 12, 2024
1 parent b10ac0d commit 995b1e7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions litellm/proxy/common_utils/management_endpoint_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ async def wrapper(*args, **kwargs):

if kwargs is None:
kwargs = {}
user_api_key_dict: UserAPIKeyAuth = kwargs.get("user_api_key_dict")
user_api_key_dict: UserAPIKeyAuth = (
kwargs.get("user_api_key_dict") or UserAPIKeyAuth()
)
parent_otel_span = user_api_key_dict.parent_otel_span
if parent_otel_span is not None:
from litellm.proxy.proxy_server import open_telemetry_logger
Expand Down Expand Up @@ -56,7 +58,9 @@ async def wrapper(*args, **kwargs):

if kwargs is None:
kwargs = {}
user_api_key_dict: UserAPIKeyAuth = kwargs.get("user_api_key_dict")
user_api_key_dict: UserAPIKeyAuth = (
kwargs.get("user_api_key_dict") or UserAPIKeyAuth()
)
parent_otel_span = user_api_key_dict.parent_otel_span
if parent_otel_span is not None:
from litellm.proxy.proxy_server import open_telemetry_logger
Expand Down

0 comments on commit 995b1e7

Please sign in to comment.