style(prometheus): apply black formatting

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
sourrrish 2026-03-21 09:21:59 +05:30
parent e0c711964f
commit 9d88a63ae6

View file

@ -974,9 +974,11 @@ class PrometheusLogger(CustomLogger):
),
client_ip=standard_logging_payload["metadata"].get("requester_ip_address"),
user_agent=standard_logging_payload["metadata"].get("user_agent"),
stream=str(standard_logging_payload.get("stream"))
if litellm.prometheus_emit_stream_label
else None,
stream=(
str(standard_logging_payload.get("stream"))
if litellm.prometheus_emit_stream_label
else None
),
)
if (
@ -1490,8 +1492,7 @@ class PrometheusLogger(CustomLogger):
# If an exception was provided (directly or via kwargs) but no status code
# could be extracted, default to 500 — an unclassified server error is still a 5xx.
if status_code is None and (
exception is not None
or (kwargs and kwargs.get("exception") is not None)
exception is not None or (kwargs and kwargs.get("exception") is not None)
):
return 500
@ -1638,9 +1639,11 @@ class PrometheusLogger(CustomLogger):
client_ip=_metadata.get("requester_ip_address"),
user_agent=_metadata.get("user_agent"),
model_id=model_id,
stream=str(request_data.get("stream"))
if litellm.prometheus_emit_stream_label
else None,
stream=(
str(request_data.get("stream"))
if litellm.prometheus_emit_stream_label
else None
),
)
_labels = prometheus_label_factory(
supported_enum_labels=self.get_labels_for_metric(