Class AnswerRelevancyMetric
java.lang.Object
com.google.genkit.plugins.evaluators.metrics.AnswerRelevancyMetric
Answer Relevancy metric evaluator.
Assesses how pertinent the generated answer is to the given prompt. Uses an LLM judge to analyze the answer and optionally uses embeddings for similarity comparison.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionevaluate(EvalDataPoint dataPoint) Evaluates the relevancy of the answer to the question.
-
Constructor Details
-
AnswerRelevancyMetric
-
-
Method Details
-
evaluate
Evaluates the relevancy of the answer to the question.- Parameters:
dataPoint- the evaluation data point- Returns:
- the evaluation response
- Throws:
Exception- if evaluation fails
-