Interface ArgumentMatcher
- All Known Implementing Classes:
TolerantArgumentMatcher
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Strategy for comparing a tool call's actual arguments against the expected arguments.
Tool-call evaluators (ToolTrajectoryEvaluator, ToolCorrectnessEvaluator,
ToolEfficiencyEvaluator) delegate argument comparison to an
ArgumentMatcher so the matching policy is decoupled from the evaluation
logic. The default implementation, TolerantArgumentMatcher, treats
numerically equal values such as 1, 1.0 and 1L as equal,
which avoids spurious mismatches from JSON number widening.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermines whether the actual arguments match the expected arguments.static ArgumentMatcherof(ArgMatchMode mode) Returns a tolerant matcher using the given key-set mode.static ArgumentMatchertolerant()Returns the default tolerant matcher usingArgMatchMode.EXACT.
-
Method Details
-
matches
Determines whether the actual arguments match the expected arguments.- Parameters:
expected- the expected argumentsactual- the actual arguments produced by the agent- Returns:
trueif the arguments match under this matcher's policy
-
tolerant
Returns the default tolerant matcher usingArgMatchMode.EXACT.Numerically equal values are treated as equal; string comparison is exact.
- Returns:
- a tolerant exact-match argument matcher
-
of
Returns a tolerant matcher using the given key-set mode.- Parameters:
mode- the key-set comparison mode- Returns:
- a tolerant argument matcher for the given mode
-