fix(vertex_ai): lint issues solved

This commit is contained in:
basil-ali-khan 2026-08-03 15:52:53 +05:00
parent dbc3824211
commit 6a74cd0ea6
2 changed files with 4 additions and 3 deletions

View file

@ -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.

View file

@ -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."