-
Notifications
You must be signed in to change notification settings - Fork 1.2k
FunctionToolset() sets default require_parameter_descriptions for tool wrapper #2601
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
docstring_format doesn't raise errors if there is a mismatch in docstring type or a missing docstring. So setting it at the toolset level isn't useful.
@@ -36,23 +36,27 @@ class FunctionToolset(AbstractToolset[AgentDepsT]): | |||
max_retries: int | |||
tools: dict[str, Tool[Any]] | |||
_id: str | None | |||
_default_require_parameter_descriptions: bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can drop the _default_
prefix here, and make it a proper dataclass field.
_default_require_parameter_descriptions: bool | |
require_parameter_descriptions: bool |
@@ -77,7 +81,7 @@ def tool( | |||
retries: int | None = None, | |||
prepare: ToolPrepareFunc[AgentDepsT] | None = None, | |||
docstring_format: DocstringFormat = 'auto', | |||
require_parameter_descriptions: bool = False, | |||
require_parameter_descriptions: bool | None = None, | |||
schema_generator: type[GenerateJsonSchema] = GenerateToolJsonSchema, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it'd make sense to also add toolset-wide defaults for docstring_format
and schema_generator
Implements #2587
This PR changes function signatures so may be considered breaking. However it should be backwards compatible still. Specifically, the types for two arguments are changed:
Changes to: