Skip to content

Commit 2b8ccd4

Browse files
bjacotgcopybara-github
authored andcommitted
chore: Exclude BaseAgent.parent_agent from serialization
Otherwise, serialization fails due to circular references. PiperOrigin-RevId: 878339838
1 parent 63f450e commit 2b8ccd4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/google/adk/agents/base_agent.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,9 @@ class MyAgent(BaseAgent):
122122
One-line description is enough and preferred.
123123
"""
124124

125-
parent_agent: Optional[BaseAgent] = Field(default=None, init=False)
125+
parent_agent: Optional[BaseAgent] = Field(
126+
default=None, init=False, exclude=True
127+
)
126128
"""The parent agent of this agent.
127129
128130
Note that an agent can ONLY be added as sub-agent once.

0 commit comments

Comments
 (0)