Repository navigation
Replies: 3 comments
|
It seems that users of adk-python are also seeking for some support to this functionality: google/adk-python#1746 |
|
Short answer: there is no supported way to inject values directly into Map<String, Object> stateDelta = Map.of(
"temp:request_id", requestId,
"temp:user_tier", userTier);
runner.runAsync(userId, sessionId, newMessage, runConfig, stateDelta);(Check the exact overload against the version you use — on current One important caveat: If you need values that must never persist in the session at all, |
|
Hi @voborl00 — following up on my answer from yesterday about propagating request-scoped attributes via the |
Uh oh!
There was an error while loading. Please reload this page.
As instances of Runner, Agent and Tool(set) are meant to be long-lived singletons, there seem to be only way how to push some variable into agent's lifecycle which is via Session object into runAsync() method. But Session also seem not to be ideal for this as it lives across many requests, so there goes my question, if is there a way how to propagate request-scoped variable into agent and better into agent's tools (ToolContext?) in order that tool used by agent will have this variable at its disposal for the given runAsync() run? Now i can only (as InvocationContext is constructed inside runAsync() method) push and then remove variable through Session with before/afterToolCallback but its more of a hack than a expected flow I suppose.
All reactions