How to initialise session state when running agent with adk web
#2199
Replies: 4 comments 3 replies
|
You may try this |
|
If you're doing it from the web interface, you can click the three dots next to the text area, select the option, and load it. Now, if you want to do it over the REST API, make a POST to http://localhost:8000/apps/my_example_agent/users/user_123/sessions with a body containing the desired state, e.g., {"some_state": "some_value"} |
|
I have a question how can I restore session that was exported using "Export current session" button in right top corner. When I click on 3 dots menu, I just see "Update state" option that opens dialog where I can paste json. I tried to paste json of that file that was exported and it looks like it just uploaded something, without restoring anything. My ADK version is 1.14.1. |
|
Glad the three-dots menu/REST API route sorted this out! @radzish on your export/restore question: that's actually expected. "Update state" only merges a flat state-delta dict while "Export current session" gives you a full session object (state, events, etc.) so pasting one into the other won't do anything. There's no proper import path for that today so worth its own issue if you'd like to see one added. Closing this out since the original question looks addressed above. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
When running the agent with a runner, initialising the session state is straight forward:
What is the easiest way to do this when running the agent via
adk web?All reactions