From 3fde52bef52b01fa0809e9af86120ad966ba1fc9 Mon Sep 17 00:00:00 2001 From: Charlie Freeman <243496084+cf3901646@users.noreply.github.com> Date: Wed, 28 Oct 2026 21:41:32 +0800 Subject: [PATCH] style(gemini): use list.extend to satisfy strict ruff rules --- litellm/llms/vertex_ai/gemini/transformation.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/litellm/llms/vertex_ai/gemini/transformation.py b/litellm/llms/vertex_ai/gemini/transformation.py index 53db17bd409..bc918381344 100644 --- a/litellm/llms/vertex_ai/gemini/transformation.py +++ b/litellm/llms/vertex_ai/gemini/transformation.py @@ -938,13 +938,15 @@ def gemini_convert_messages_with_history( ) ## check if gemini_tool_call already exists in assistant_content before this batch pre_existing_parts = list(assistant_content) - for gemini_tool_call_part in gemini_tool_call_parts: + assistant_content.extend( + gemini_tool_call_part + for gemini_tool_call_part in gemini_tool_call_parts if not check_if_part_exists_in_parts( pre_existing_parts, gemini_tool_call_part, excluded_keys=["thoughtSignature"], - ): - assistant_content.append(gemini_tool_call_part) + ) + ) # Only record this as the active tool-call message when it actually # carries tool calls. The `if` guard above is also entered for a # text-only assistant message (`assistant_msg.get("tool_calls", [])