Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

style(cost): collapse a getattr call that fits the line limit

Marty Sullivan4e51ff8a6dbc
diff --git a/litellm/responses/utils.py b/litellm/responses/utils.py
index 7e0acd14b9c..b2844834860 100644
--- a/litellm/responses/utils.py
+++ b/litellm/responses/utils.py
@@ -1137,9 +1137,7 @@ class ResponseAPILoggingUtils:
text_tokens=getattr(response_api_usage.input_tokens_details, "text_tokens", None),
image_tokens=getattr(response_api_usage.input_tokens_details, "image_tokens", None),
cache_write_tokens=getattr(response_api_usage.input_tokens_details, "cache_write_tokens", None),
- web_search_requests=getattr(
- response_api_usage.input_tokens_details, "web_search_requests", None
- ),
+ web_search_requests=getattr(response_api_usage.input_tokens_details, "web_search_requests", None),
google_maps_grounding_requests=getattr(
response_api_usage.input_tokens_details, "google_maps_grounding_requests", None
),