Skip to content

Commit 89c4183

Browse files
Update agent.py
1 parent b01105c commit 89c4183

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/agents/agent.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,16 +222,15 @@ class Agent(AgentBase, Generic[TContext]):
222222
to True. This ensures that the agent doesn't enter an infinite loop of tool usage."""
223223

224224
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.
227226
228227
Notes:
229228
- Uses `dataclasses.replace`, which performs a **shallow copy**.
230229
- Mutable attributes like `tools` and `handoffs` are shallow-copied:
231230
new list objects are created only if overridden, but their contents
232231
(tool functions and handoff objects) are shared with the original.
233232
- To modify these independently, pass new lists when calling `clone()`.
234-
233+
235234
Example:
236235
```python
237236
new_agent = agent.clone(instructions="New instructions")

0 commit comments

Comments
 (0)