We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 405cddb commit 9841c5eCopy full SHA for 9841c5e
src/agents/agent.py
@@ -187,6 +187,10 @@ class Agent(Generic[TContext]):
187
"""Whether to reset the tool choice to the default value after a tool has been called. Defaults
188
to True. This ensures that the agent doesn't enter an infinite loop of tool usage."""
189
190
+ def __post_init__(self):
191
+ if not isinstance(self.name, str):
192
+ raise TypeError(f"Agent name must be a string, got {type(self.name).__name__}")
193
+
194
def clone(self, **kwargs: Any) -> Agent[TContext]:
195
"""Make a copy of the agent, with the given arguments changed. For example, you could do:
196
```
0 commit comments