From 3bc391c16eb5622d741e09c2fdef6bd139c8b1cf Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Wed, 23 Sep 2026 13:02:01 +0000 Subject: [PATCH] style(gemini): format count_tokens request body per ruff format Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- litellm/llms/gemini/count_tokens/handler.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/litellm/llms/gemini/count_tokens/handler.py b/litellm/llms/gemini/count_tokens/handler.py index ed75c9d5507..8827a812085 100644 --- a/litellm/llms/gemini/count_tokens/handler.py +++ b/litellm/llms/gemini/count_tokens/handler.py @@ -141,10 +141,20 @@ class GoogleAIStudioTokenCounter: "generateContentRequest": { # mutable-ok: httpx json body takes a plain dict "model": f"models/{model}", "contents": cleaned_contents, - **( # mutable-ok: httpx json body takes a plain dict - {"systemInstruction": system_instruction} if system_instruction is not None else {} + **( + { # mutable-ok: httpx json body takes a plain dict + "systemInstruction": system_instruction, + } + if system_instruction is not None + else {} # mutable-ok: httpx json body takes a plain dict + ), + **( + { # mutable-ok: httpx json body takes a plain dict + "tools": tools, + } + if tools is not None + else {} # mutable-ok: httpx json body takes a plain dict ), - **({"tools": tools} if tools is not None else {}), # mutable-ok: httpx json body takes a plain dict } } )