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