Skip to content

Commit c51ea0b

Browse files
google-genai-botcopybara-github
authored andcommitted
fix: VertexSessionService with adding base_url override to base api override without removing initialized http_options
PiperOrigin-RevId: 813319796
1 parent 8f3ca03 commit c51ea0b

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/google/adk/sessions/vertex_ai_session_service.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -376,15 +376,17 @@ def _get_api_client(self) -> genai.client.BaseApiClient:
376376
377377
It needs to be instantiated inside each request so that the event loop
378378
management can be properly propagated.
379+
380+
Returns:
381+
An API client for the given project and location.
379382
"""
380-
api_client = genai.client.BaseApiClient(
381-
vertexai=True, project=self._project, location=self._location
383+
return genai.client.BaseApiClient(
384+
vertexai=True,
385+
project=self._project,
386+
location=self._location,
387+
http_options=self._api_client_http_options_override(),
382388
)
383389

384-
if new_options := self._api_client_http_options_override():
385-
api_client._http_options = new_options
386-
return api_client
387-
388390

389391
def _is_vertex_express_mode(
390392
project: Optional[str], location: Optional[str]

0 commit comments

Comments
 (0)