We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
ReadOnlyContext.state
MappingProxyType
1 parent c906245 commit 68b61e6Copy full SHA for 68b61e6
1 file changed
src/google/adk/agents/readonly_context.py
@@ -53,8 +53,14 @@ def agent_name(self) -> str:
53
return self._invocation_context.agent.name
54
55
@property
56
- def state(self) -> Mapping[str, Any]:
57
- """The state of the current session. READONLY field."""
+ def state(self) -> MappingProxyType[str, Any]:
+ """The state of the current session. READONLY field.
58
+
59
+ Note: This property returns a merged view of ephemeral request_state and
60
+ persistent session.state using ChainMap. Changes to the underlying
61
+ request_state or session.state dictionaries will be reflected through
62
+ this view, but direct writes through this property are prevented.
63
+ """
64
return MappingProxyType(
65
ChainMap(
66
self._invocation_context.request_state,
0 commit comments