Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9841c5e

Browse files
authored
Added runtime validation for Agent name field
1 parent405cddb commit9841c5e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

‎src/agents/agent.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,10 @@ class Agent(Generic[TContext]):
187187
"""Whether to reset the tool choice to the default value after a tool has been called. Defaults
188188
to True. This ensures that the agent doesn't enter an infinite loop of tool usage."""
189189

190+
def__post_init__(self):
191+
ifnotisinstance(self.name,str):
192+
raiseTypeError(f"Agent name must be a string, got{type(self.name).__name__}")
193+
190194
defclone(self,**kwargs:Any)->Agent[TContext]:
191195
"""Make a copy of the agent, with the given arguments changed. For example, you could do:
192196
```

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp