AG-018Agent · Final resultlayaeval.AgentCorrectness
Agent Correctness
Is the final result the correct one?
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
| Parameter | Value | Description |
|---|---|---|
| Class | AgentCorrectness | Python evaluator class in layaeval |
| Required Fields | "task", "final_result", "ground_truth" | Arguments expected in the call signature |
| Default Threshold | >= 3.0 | Passes when quality score is at or above this value |
| Category | Agent Evaluation | Final result (Is the last message true, complete and correct?) |
Python Example
agent-correctness.py
1from layaeval import AgentCorrectness23metric = AgentCorrectness(threshold=3.0) # passes at or above 3.045res = 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)1011print(res.passed, res.value, res.confidence)
Related Agent Checks
Other checks in Final result
AG-014Read →
Agent Groundedness
Is the final answer backed by what the tools returned?
AG-015Read →
Agent Hallucination
Did the agent claim results that never happened?
AG-016Read →
Agent Response Relevance
Does the final message answer the user's request?
AG-017Read →
Answer Completeness
Did the final reply cover every part of the task?