poetry run deploy-remote --list_sessions --resource_id 332571481076662272 --user_id shawnho
Sessions for user 'shawnho':
Traceback (most recent call last):
File "", line 1, in
File "/home/shawnho/deploy-adk-agent-engine/deployment/remote.py", line 180, in main
list_sessions(FLAGS.resource_id, user_id)
File "/home/shawnho/deploy-adk-agent-engine/deployment/remote.py", line 99, in list_sessions
print(f"- Session ID: {session['id']}")
~~~~~~~^^^^^^
It is likely the ADK is updated. The one which works for me is:
def list_sessions(resource_id: str, user_id: str) -> None:
"""Lists all sessions for the specified user."""
remote_app = agent_engines.get(resource_id)
sessions = remote_app.list_sessions(user_id=user_id)
print(f"Sessions for user '{user_id}':")
for session in sessions['sessions']:
print(f"- Session ID: {session['id']}")
poetry run deploy-remote --list_sessions --resource_id 332571481076662272 --user_id shawnho
Sessions for user 'shawnho':
Traceback (most recent call last):
File "", line 1, in
File "/home/shawnho/deploy-adk-agent-engine/deployment/remote.py", line 180, in main
list_sessions(FLAGS.resource_id, user_id)
File "/home/shawnho/deploy-adk-agent-engine/deployment/remote.py", line 99, in list_sessions
print(f"- Session ID: {session['id']}")
~~~~~~~^^^^^^
It is likely the ADK is updated. The one which works for me is:
def list_sessions(resource_id: str, user_id: str) -> None:
"""Lists all sessions for the specified user."""
remote_app = agent_engines.get(resource_id)
sessions = remote_app.list_sessions(user_id=user_id)
print(f"Sessions for user '{user_id}':")
for session in sessions['sessions']:
print(f"- Session ID: {session['id']}")