The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
fix lint error
Sameerlite573230348dd7
diff --git a/litellm/llms/vertex_ai/vertex_llm_base.py b/litellm/llms/vertex_ai/vertex_llm_base.pyindex f89ee92294e..139cea08c51 100644--- a/litellm/llms/vertex_ai/vertex_llm_base.py+++ b/litellm/llms/vertex_ai/vertex_llm_base.py@@ -239,6 +239,7 @@ class VertexBase:stream=stream,auth_header=None,url=default_api_base,+ model=model,)return api_base@@ -387,19 +388,19 @@ class VertexBase:) -> Tuple[str, str]:"""Handle reauthentication when credentials refresh fails.-+This method clears the cached credentials and attempts to reload them once.It should only be called when "Reauthentication is needed" error occurs.-+Args:credentials: The original credentialsproject_id: The project IDcredential_cache_key: The cache key to clearerror: The original error that triggered reauthentication-+Returns:Tuple of (access_token, project_id)-+Raises:The original error if reauthentication fails"""@@ -407,11 +408,11 @@ class VertexBase:f"Handling reauthentication for project_id: {project_id}. "f"Clearing cache and retrying once.")-+# Clear the cached credentialsif credential_cache_key in self._credentials_project_mapping:del self._credentials_project_mapping[credential_cache_key]-+# Retry once with _retry_reauth=True to prevent infinite recursiontry:return self.get_access_token(@@ -441,12 +442,12 @@ class VertexBase:3. Check if loaded credentials have expired4. If expired, refresh credentials5. Return access token and project id-+Args:credentials: The credentials to use for authenticationproject_id: The Google Cloud project ID_retry_reauth: Internal flag to prevent infinite recursion during reauthentication-+Returns:Tuple of (access_token, project_id)"""