RAG-009RAG · Answer qualitylayaeval.ResponseRelevance

Response Relevance

Does the answer actually address what was asked?

QUESTIONWhen does it open?WHAT WAS ASKEDOpens at 9amANSWERAnswers what was asked
Simulation state:
When it passes

Right on target.

Threshold satisfied: evaluation score >= 3.0.

When it fails

Talks about something else.

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

SDK Specification

ParameterValueDescription
ClassResponseRelevancePython evaluator class in layaeval
Required Fields"query", "response"Arguments expected in the call signature
Default Threshold>= 3.0Passes when quality score is at or above this value
CategoryRAG EvaluationAnswer quality (Is the reply on topic, complete and correct?)

Python Example

pip install layaeval
response-relevance.py
1from layaeval import ResponseRelevance
2
3metric = ResponseRelevance(threshold=3.0) # passes at or above 3.0
4
5res = metric(
6 query="What is the capital of France?",
7 response="Paris is the capital of France.",
8)
9
10print(res.passed, res.value, res.confidence)

Related RAG Checks

Other checks in Answer quality

View all 42 checks →