mirror of
https://github.com/encounter/adk-python.git
synced 2026-07-09 18:19:28 -07:00
fix: Process ListEvents response correctly when getSession is called
When get session is being called on a session with more than 1 page of events (100+), the response of the subsequent listevents calls fails due to missing parsing logic. This change fixes the processing of the listevents responses. PiperOrigin-RevId: 783166959
This commit is contained in:
committed by
Copybara-Service
parent
498ce906dd
commit
a50419961c
@@ -201,7 +201,13 @@ class MockApiClient:
|
||||
if match:
|
||||
session_id = match.group(2)
|
||||
if match.group(3):
|
||||
return {'sessionEvents': MOCK_EVENT_JSON_3}
|
||||
page_token = match.group(3)
|
||||
if page_token == 'my_token':
|
||||
response = {'sessionEvents': MOCK_EVENT_JSON_3}
|
||||
response['nextPageToken'] = 'my_token2'
|
||||
return response
|
||||
else:
|
||||
return {}
|
||||
events_tuple = self.event_dict.get(session_id, ([], None))
|
||||
response = {'sessionEvents': events_tuple[0]}
|
||||
if events_tuple[1]:
|
||||
|
||||
Reference in New Issue
Block a user