fix: VertexSessionService with adding base_url override to base api override without removing initialized http_options

PiperOrigin-RevId: 813319796
This commit is contained in:
Google Team Member
2025-09-30 10:13:19 -07:00
committed by Copybara-Service
parent 8f3ca0359e
commit c51ea0b52e
@@ -376,14 +376,16 @@ class VertexAiSessionService(BaseSessionService):
It needs to be instantiated inside each request so that the event loop
management can be properly propagated.
"""
api_client = genai.client.BaseApiClient(
vertexai=True, project=self._project, location=self._location
)
if new_options := self._api_client_http_options_override():
api_client._http_options = new_options
return api_client
Returns:
An API client for the given project and location.
"""
return genai.client.BaseApiClient(
vertexai=True,
project=self._project,
location=self._location,
http_options=self._api_client_http_options_override(),
)
def _is_vertex_express_mode(