fix(vertex_ai/common_utils.py): fix handling constructed url with default vertex config

This commit is contained in:
Krrish Dholakia 2025-03-22 11:32:01 -07:00
parent b44b3bd36b
commit 06e69a414e
4 changed files with 98 additions and 17 deletions

View file

@ -150,19 +150,17 @@ class PassthroughEndpointRouter:
"""
Get the vertex credentials for the given project-id, location
"""
default_vertex_config: Optional[VertexPassThroughCredentials] = None
deployment_key = self._get_deployment_key(
project_id=project_id,
location=location,
)
if deployment_key is None:
return default_vertex_config
return self.default_vertex_config
if deployment_key in self.deployment_key_to_vertex_credentials:
return self.deployment_key_to_vertex_credentials[deployment_key]
else:
return default_vertex_config
return self.default_vertex_config
def _get_credential_name_for_provider(
self,