From 6a74cd0ea622e4034bf7db214164d73ea513295e Mon Sep 17 00:00:00 2001 From: basil-ali-khan Date: Mon, 3 Aug 2026 15:52:53 +0500 Subject: [PATCH] fix(vertex_ai): lint issues solved --- litellm/llms/vertex_ai/common_utils.py | 4 ++-- litellm/llms/vertex_ai/vertex_llm_base.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/litellm/llms/vertex_ai/common_utils.py b/litellm/llms/vertex_ai/common_utils.py index 95690284148..958a571c95e 100644 --- a/litellm/llms/vertex_ai/common_utils.py +++ b/litellm/llms/vertex_ai/common_utils.py @@ -1,7 +1,7 @@ import re from copy import deepcopy from enum import Enum -from typing import Any, Literal, List, get_type_hints +from typing import Any, Literal, get_type_hints import httpx @@ -495,7 +495,7 @@ def normalize_gemini_model_path(model: str) -> str: return f"models/{model}" -def _check_text_in_content(parts: List[PartType]) -> bool: +def _check_text_in_content(parts: list[PartType]) -> bool: """ check that user_content has 'text' parameter. - Known Vertex Error: Unable to submit request because it must have a text parameter. diff --git a/litellm/llms/vertex_ai/vertex_llm_base.py b/litellm/llms/vertex_ai/vertex_llm_base.py index c93d676fe4e..70967681126 100644 --- a/litellm/llms/vertex_ai/vertex_llm_base.py +++ b/litellm/llms/vertex_ai/vertex_llm_base.py @@ -638,7 +638,8 @@ class VertexBase: # For Gemini (Google AI Studio), construct the full path like other providers if model is None: raise ValueError("Model parameter is required for Gemini custom API base URLs") - url = "{}/{}:{}".format(api_base, normalize_gemini_model_path(model), endpoint) + # url = "{}/{}:{}".format(api_base, normalize_gemini_model_path(model), endpoint) + url = f"{api_base}/{normalize_gemini_model_path(model)}:{endpoint}" if gemini_api_key is None: raise ValueError( "Missing Gemini API key. Set the GEMINI_API_KEY or GOOGLE_API_KEY environment variable."