Skip to main content

agrag.eval.adapter.to_json_case

to_json_case(input:str, actual:BaseModel, expected:BaseModel) -> LLMTestCase

Build a test case that carries structured data as JSON.

LLMTestCase has no field for structured gold data, so both models are serialized to JSON in actual_output and expected_output. The JSON also shows in DeepEval reports.

Parameters:

  • input (str) – The input text, such as a question or a chunk.
  • actual (BaseModel) – The system output.
  • expected (BaseModel) – The gold data.