From 944e54d947121d0103f9993ced76e8ee7ae5700a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=90=8D=E9=94=90?= <1565842059@qq.com> Date: Mon, 31 Aug 2026 00:17:35 +0800 Subject: [PATCH] fix(vertex-ai): document request payload normalization --- .../vertex_ai/gemini/vertex_and_google_ai_studio_gemini.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/litellm/llms/vertex_ai/gemini/vertex_and_google_ai_studio_gemini.py b/litellm/llms/vertex_ai/gemini/vertex_and_google_ai_studio_gemini.py index f8715b510a6..624e5ed2a0a 100644 --- a/litellm/llms/vertex_ai/gemini/vertex_and_google_ai_studio_gemini.py +++ b/litellm/llms/vertex_ai/gemini/vertex_and_google_ai_studio_gemini.py @@ -406,7 +406,9 @@ class VertexGeminiConfig(VertexAIBaseConfig, BaseConfig): ] @staticmethod - def _deduplicate_tools(optional_params: dict) -> None: + def _deduplicate_tools( + optional_params: dict, # mutable-ok: optional parameters use the existing request shape + ) -> None: tools: Final = optional_params.get("tools") if not isinstance(tools, list): return @@ -415,7 +417,7 @@ class VertexGeminiConfig(VertexAIBaseConfig, BaseConfig): for tool in tools: if tool not in deduplicated: deduplicated.append(tool) - optional_params["tools"] = deduplicated + optional_params["tools"] = deduplicated # rebind-ok: normalize request payload before serialization def _map_service_tier_param(self, value: str, optional_params: dict) -> None: """