File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -222,16 +222,15 @@ class Agent(AgentBase, Generic[TContext]):
222
222
to True. This ensures that the agent doesn't enter an infinite loop of tool usage."""
223
223
224
224
def clone (self , ** kwargs : Any ) -> Agent [TContext ]:
225
- """
226
- Make a copy of the agent, with the given arguments changed.
225
+ """Make a copy of the agent, with the given arguments changed.
227
226
228
227
Notes:
229
228
- Uses `dataclasses.replace`, which performs a **shallow copy**.
230
229
- Mutable attributes like `tools` and `handoffs` are shallow-copied:
231
230
new list objects are created only if overridden, but their contents
232
231
(tool functions and handoff objects) are shared with the original.
233
232
- To modify these independently, pass new lists when calling `clone()`.
234
-
233
+
235
234
Example:
236
235
```python
237
236
new_agent = agent.clone(instructions="New instructions")
You can’t perform that action at this time.
0 commit comments