v1

latestOpenAPI 3.0.3Apache 2.02026-07-2685172326.0 KB
Metrics

Evaluate an answer

Evaluate the correctness and completeness of a response from an assistant or a RAG system. The correctness and completeness are evaluated based on the precision and recall of the generated answer with respect to the ground truth answer facts. Alignment is the harmonic mean of correctness and completeness.

For guidance and examples, see Evaluate answers.

post/evaluation/metrics/alignment

Headers

X-Pinecone-Api-Versionstring required

Required date-based version header

Request body

questionstring required

The question for which the answer was generated.

answerstring required

The generated answer.

ground_truth_answerstring required

The ground truth answer to the question.

Example request

{
  "question": "What is the capital city of Spain?",
  "answer": "Barcelona.",
  "ground_truth_answer": "Madrid."
}

Response

The evaluation metrics and reasoning for the generated answer.