Package com.tnsai.evaluation.evaluators.agent
Where the existing top-level evaluators package scores
single-turn text outputs (response quality, JSON correctness, cost
efficiency) and evaluators.geval scores them with an LLM
judge against caller-supplied criteria, this package scores
agent traces — the plan, the steps the agent took, the
tools it picked, and the end state.
The four metrics
PlanAdherenceEvaluator— LLM judge: did the agent stick to the declared plan?StepEfficiencyEvaluator— deterministic: was the goal reached without burning extra tool calls? Pairs an expected step count (fromexpectedToolSequenceormetadata['expected_steps']) against the actual count.ToolCorrectnessEvaluator— LLM judge: were the chosen tools appropriate for the task? Softer signal than the deterministicToolSelectionEvaluator, which checks exact-sequence precision/recall.TaskCompletionEvaluator— LLM judge: did the final response actually solve the task? Fixed-contract complement to G-Eval's criteria-driven grading.
How they relate
Adherence asks "did you do the right thing?", efficiency asks "did you do it without waste?", correctness asks "were the right tools picked?", completion asks "did you reach the destination?". An agent can max out adherence on a wrong plan; conversely it can ignore the plan and still nail completion. Run them together to triangulate.
Plug-in style
Each metric implements the existing Evaluator
SPI, so existing harnesses
(EvalAssert,
BenchmarkRunner) accept them
without changes.
- Since:
- 0.10.1 (TNS-373)
-
ClassesClassDescriptionAgent-tier metric: did the agent stick to its declared plan?Agent-tier metric: did the agent reach the goal without burning extra tool calls?Agent-tier metric: did the agent's final state actually solve the task?Agent-tier metric: were the tools the agent invoked semantically appropriate for the task?