adk-python icon indicating copy to clipboard operation
adk-python copied to clipboard

VertexAISession not handling HttpResponses properly

Open roman-loosli opened this issue 1 year ago • 7 comments

** 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:

  1. Create SessionServicde
  2. Create Session
  3. Call AgentEngine.stream_query() with the session_id of said session
  4. 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

roman-loosli avatar Jun 20 '25 07:06 roman-loosli

@DeanChensj Could you help take a look?

hangfei avatar Jun 24 '25 20:06 hangfei

This is fixed in 1.4.2. Could you retry?

hangfei avatar Jun 24 '25 21:06 hangfei

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

enkai-liu avatar Jul 03 '25 03:07 enkai-liu

yes, this seems to work again. intermediary solution was to fix google-genai=1.20.0

roman-loosli avatar Jul 03 '25 05:07 roman-loosli

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?

i0mod avatar Jul 19 '25 09:07 i0mod

Hi @i0mod, could you double check on the google-genai and google-adk version? And how did you specifiy the version in your deployment?

DeanChensj avatar Jul 21 '25 03:07 DeanChensj

It was an error on my side. Sorry for the waste of time!

i0mod avatar Jul 21 '25 12:07 i0mod