VertexAISession not handling HttpResponses properly
** Please make sure you read the contribution guide and file the issues in the right place. ** Contribution guide.
Describe the bug VertexAISessionService does not handle HttpResponse properly. When passing a session created by the service to an agent hosted on AgentEngine, we receive following error:
google/adk/sessions/vertex_ai_session_service.py", line 92, in create_session session_id = api_response['name'].split('/')[-3] TypeError: 'HttpResponse' object is not subscriptable
To Reproduce Steps to reproduce the behavior:
- Create SessionServicde
- Create Session
- Call AgentEngine.stream_query() with the session_id of said session
- See error
Expected behavior AgentEngine should be queried based on the session provided
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: macOS
- Python version(python -V): 3.9.6
- ADK version(pip show google-adk): 1.4.1
Additional context Might be related to https://github.com/google/adk-python/issues/1536
@DeanChensj Could you help take a look?
This is fixed in 1.4.2. Could you retry?
When I deploy adk-sample's RAG agent using python ./deployment/deploy.py and then run it using 'python ./deployment/run.py', I still get the error like TypeError: 'HttpResponse' object is not subscriptable. The full error log is as attached. I already upgraded to adk 1.5.0.
The same run.py code work a few weeks ago with the same ragCorpora and service account.
downloaded-logs-20250702-225721.csv downloaded-logs-20250702-225600.json
yes, this seems to work again. intermediary solution was to fix google-genai=1.20.0
Hello, I get the same error. I used google-genai=1.20.0 and adk=1.4.2 as well as the new versions (google-genai=1.26.0 and adk=1.7.0) but it does not seem to solve the issue. Does anyone have any suggestions on what I should do?
Hi @i0mod, could you double check on the google-genai and google-adk version? And how did you specifiy the version in your deployment?
It was an error on my side. Sorry for the waste of time!