Skip to content

Commit 6673a30

Browse files
Update agent.py
1 parent 89c4183 commit 6673a30

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/agents/agent.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,21 +223,19 @@ class Agent(AgentBase, Generic[TContext]):
223223

224224
def clone(self, **kwargs: Any) -> Agent[TContext]:
225225
"""Make a copy of the agent, with the given arguments changed.
226-
227226
Notes:
228227
- Uses `dataclasses.replace`, which performs a **shallow copy**.
229228
- Mutable attributes like `tools` and `handoffs` are shallow-copied:
230229
new list objects are created only if overridden, but their contents
231230
(tool functions and handoff objects) are shared with the original.
232231
- To modify these independently, pass new lists when calling `clone()`.
233-
234232
Example:
235233
```python
236234
new_agent = agent.clone(instructions="New instructions")
237235
```
238236
"""
239237
return dataclasses.replace(self, **kwargs)
240-
238+
241239
def as_tool(
242240
self,
243241
tool_name: str | None,

0 commit comments

Comments
 (0)