mirror of
https://github.com/encounter/adk-python.git
synced 2026-07-09 18:19:28 -07:00
fix: raise ValueError when sessionId and userId are incorrect combination(#1653)
Merge https://github.com/google/adk-python/pull/1655 Fix #1653 When session_id and user_id are incorrect combination on vertex ai session service, it should not return the session. COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/1655 from soundTricker:fix/1653-invalid-session 7a3dee2fc75602a2685ea922799cc5f5ba666e97 PiperOrigin-RevId: 776648361
This commit is contained in:
committed by
Copybara-Service
parent
c13c9875cf
commit
4e765ae2f3
@@ -178,6 +178,9 @@ class VertexAiSessionService(BaseSessionService):
|
||||
)
|
||||
get_session_api_response = _convert_api_response(get_session_api_response)
|
||||
|
||||
if get_session_api_response['userId'] != user_id:
|
||||
raise ValueError(f'Session not found: {session_id}')
|
||||
|
||||
session_id = get_session_api_response['name'].split('/')[-1]
|
||||
update_timestamp = isoparse(
|
||||
get_session_api_response['updateTime']
|
||||
|
||||
Reference in New Issue
Block a user