Skip to content

Fix optional args toolcalling #1538

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

Merged
merged 8 commits into from
Jul 10, 2025
Merged

Conversation

aymeric-roucher
Copy link
Collaborator

No description provided.

@aymeric-roucher aymeric-roucher force-pushed the fix-optional-args-toolcalling branch from 1a4461b to 702199d Compare July 9, 2025 16:46
Copy link
Member

@albertvillanova albertvillanova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there might be some confusion around the term "nullable" in this context.

We should clarify terminology: "nullable" can be interpreted in two ways:

  • either that the argument can explicitly be set to None,
  • or that it's optional in the sense that it has a default value and doesn't need to be passed at all.

I think that distinction is important when reasoning about how LLMs should construct tool arguments.

@aymeric-roucher
Copy link
Collaborator Author

aymeric-roucher commented Jul 10, 2025

"nullable": True should be equivalent to "required": False, I agree with refactoring in a follow up PR to switch to using required instead of nullable. Do you see any inconsistency with this? Else we should go ahead and merge this IMO, it's a required fix else validate_tool_arguments is a breaking change.

Copy link
Member

@albertvillanova albertvillanova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I just added a complete test suite (some of them to be addressed in a subsequent PR).

@albertvillanova albertvillanova merged commit b1c72ff into main Jul 10, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants