AG-018Agent · Final resultlayaeval.AgentCorrectness

Agent Correctness

Is the final result the correct one?

AGENT RESULTCORRECT ANSWERHotelLumièreHotelLumièreDateMar 4DateMar 4Matches the correct answer
Simulation state:
When it passes

Matches the expected result.

Threshold satisfied: evaluation score >= 3.0.

When it fails

Differs from it.

Violation detected: execution flagged for human review or fallback routing.

SDK Specification

ParameterValueDescription
ClassAgentCorrectnessPython evaluator class in layaeval
Required Fields"task", "final_result", "ground_truth"Arguments expected in the call signature
Default Threshold>= 3.0Passes when quality score is at or above this value
CategoryAgent EvaluationFinal result (Is the last message true, complete and correct?)

Python Example

pip install layaeval
agent-correctness.py
1from layaeval import AgentCorrectness
2
3metric = AgentCorrectness(threshold=3.0) # passes at or above 3.0
4
5res = metric(
6 task="Book a hotel in Paris for 2 guests on Mar 4.",
7 final_result="Booked Hotel Lumière, Mar 4, 2 guests.",
8 ground_truth="Paris",
9)
10
11print(res.passed, res.value, res.confidence)

Related Agent Checks

Other checks in Final result

View all 42 checks →