You are adding a tool-use evaluation gate to an inventory agent by using Agent Framework for Python. Each evaluation item contains an expected tool call with its name and selected argument values.
The gate must:
- Reject a call to a different tool even when its argument values match.
- Reject an incorrect value for any expected argument.
- Accept additional argument keys when the tool name and expected values match.
Two custom check functions are already implemented, as described in the exhibit.
| Custom check | Behavior |
|---|---|
strict_tool_match | Checks the expected tool name and requires exact equality of the argument dictionaries. |
argument_subset_match | Checks the expected argument values as a subset of the actual arguments, without checking the tool name. |
Which evaluator configuration meets the gate's requirements?
Use tool_call_args_match to check the expected tool name together with the listed argument values. Its argument comparison permits extra keys, so evaluation items can specify the values that matter without requiring an identical argument dictionary. The other checks either omit a required comparison or impose a stricter comparison than the gate permits.
- Not correct:
LocalEvaluator(argument_subset_match). The source's built-in argument-matching check validates both names and arguments. The custom function described here omits the name comparison and can therefore accept a call to the wrong tool. - Correct:
LocalEvaluator(tool_call_args_match). The source states that tool_call_args_match checks tool names and argument values, using subset matching for arguments. It therefore rejects a wrong name or expected value while allowing extra argument keys. - Not correct:
LocalEvaluator(tool_calls_present). The source describes tool_calls_present as checking whether expected tool names occur. That does not validate the argument values required by this gate. - Not correct:
LocalEvaluator(strict_tool_match). The source allows custom check functions in LocalEvaluator. However, this custom function requires dictionary equality, so it rejects additional keys that the required subset matching would accept.
- EvaluationMicrosoft Learn