fix: Use sync request method in VertexAiSessionService. The api_client has it own event loop management.

PiperOrigin-RevId: 761250268
This commit is contained in:
Shangjie Chen
2025-05-20 15:19:47 -07:00
committed by Copybara-Service
parent b299241b56
commit 53b14325ce
2 changed files with 7 additions and 23 deletions

View File

@@ -125,22 +125,6 @@ class MockApiClient:
this.event_dict: dict[str, list[Any]] = {}
def request(self, http_method: str, path: str, request_dict: dict[str, Any]):
"""Mocks the API Client request method."""
if http_method == 'GET':
if re.match(SESSIONS_REGEX, path):
match = re.match(SESSIONS_REGEX, path)
return {
'sessions': [
session
for session in self.session_dict.values()
if session['userId'] == match.group(2)
],
}
raise ValueError(f'Unsupported sync path: {path}')
async def async_request(
self, http_method: str, path: str, request_dict: dict[str, Any]
):
"""Mocks the API Client request method."""
if http_method == 'GET':
if re.match(SESSION_REGEX, path):