Fix AttributeError: NoneType object has no attribute 'get' (#14609)

This commit is contained in:
Oleksandr Tereshchenko 2025-09-17 07:38:01 +03:00 committed by GitHub
parent 93524cf19b
commit f507bf8881
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -832,7 +832,8 @@ class _PROXY_MaxParallelRequestsHandler_v3(CustomLogger):
litellm_parent_otel_span: Union[Span, None] = (
_get_parent_otel_span_from_kwargs(kwargs)
)
user_api_key = kwargs["litellm_params"]["metadata"].get("user_api_key")
litellm_metadata = kwargs["litellm_params"]["metadata"]
user_api_key = litellm_metadata.get("user_api_key") if litellm_metadata else None
pipeline_operations: List[RedisPipelineIncrementOperation] = []
if user_api_key: