Repository navigation
Python: fix(eval): validate tool_names and mode in tool_called_check - #8695
Manohar Paturi (ManoharPaturi) wants to merge 1 commit into
Conversation
Signed-off-by: Manohar Paturi <186662190+ManoharPaturi@users.noreply.github.com>
|
Thank you for proposing this change. I am closing this PR for now because it has no linked issue, and I could not find an issue covering this specific problem. Our contribution guidelines ask contributors to create or reuse an issue and discuss the approach before nontrivial changes (with an exception for trivial changes). The repository PR template asks for Motivation & Context, Description & Review Guide, a Related Issue linked with a closing keyword such as |
When using tool_called_check in evaluation suites, there was no upfront parameter validation for arguments passed into the checker factory.
Calling tool_called_check() with no arguments created a check that vacuously passed conversations because an empty set is trivially a subset of any called set. Also, passing an unsupported mode fell through the conditional branches and reported a misleading failure reason, while whitespace-only or empty tool names could never match valid function calls.
This PR adds upfront validation in tool_called_check to verify that at least one non-empty tool name is supplied and that mode is strictly all or any. I also added unit tests covering these validation checks in test_local_eval.py.