Skip to content

Conversation

g-eoj
Copy link

@g-eoj g-eoj commented Aug 18, 2025

Implements #2587

  • code
  • docstrings
  • tests

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:

require_parameter_descriptions: bool = False,

Changes to:

require_parameter_descriptions: bool | None = None,

g-eoj added 5 commits August 18, 2025 09:33
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.
@g-eoj g-eoj marked this pull request as ready for review August 18, 2025 19:49
@g-eoj g-eoj changed the title FunctionToolset() sets default kwargs for tool wrapper FunctionToolset() sets default require_parameter_descriptions for tool wrapper Aug 18, 2025
@@ -36,23 +36,27 @@ class FunctionToolset(AbstractToolset[AgentDepsT]):
max_retries: int
tools: dict[str, Tool[Any]]
_id: str | None
_default_require_parameter_descriptions: bool
Copy link
Collaborator

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.

Suggested change
_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,
Copy link
Collaborator

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

@g-eoj g-eoj requested a review from DouweM August 29, 2025 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants