Skip to main content

agrag.eval.answer.answer_case

answer_case(question:str, result:AgentRunResult, reference:str) -> LLMTestCase

Build the test case that every answer-quality metric scores.

retrieval_context holds the evidence the agent saw, as the ledger rendered it, in key order. metadata["citations"] maps each key to that text for CitationAccuracyMetric.

Parameters:

  • question (str) – The question the agent answered.
  • result (AgentRunResult) – The result of agent.ainvoke for that question.
  • reference (str) – The reference answer.

Returns:

  • LLMTestCase – The test case with the answer and rendered evidence.