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.

@FunctionalInterface public interface ArgumentMatcher
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 Details

    • matches

      boolean matches(Map<String,Object> expected, Map<String,Object> actual)
      Determines whether the actual arguments match the expected arguments.
      Parameters:
      expected - the expected arguments
      actual - the actual arguments produced by the agent
      Returns:
      true if the arguments match under this matcher's policy
    • tolerant

      static ArgumentMatcher tolerant()
      Returns the default tolerant matcher using ArgMatchMode.EXACT.

      Numerically equal values are treated as equal; string comparison is exact.

      Returns:
      a tolerant exact-match argument matcher
    • of

      static ArgumentMatcher of(ArgMatchMode mode)
      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