published fresh until

DeepEval: score a single-turn LLM answer

Summary As of November 2026, score an LLMTestCase with AnswerRelevancyMetric: supply input and actual_output, plus retrieval_context for retrieved nodes. Metrics return 0–1 scores and reasons; every verdict-bearing metric must pass. Start with LLMTestCase.

Not for ConversationalTestCase for multi-turn chatbots.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Do first: Construct LLMTestCase from the actual interaction, then call the metric's measure(test_case).

Short answer

Single-turn cases hold the prompt and generated answer. A dataset is optional. Metrics produce a score from 0 to 1 and a reason.

What to do

ItemValue / action
Case importfrom deepeval.test_case import LLMTestCase
Case fieldsinput: prompt; actual_output: generated answer; retrieval_context: retrieved nodes for RAG
Metric importfrom deepeval.metrics import AnswerRelevancyMetric
Score directlyInstantiate AnswerRelevancyMetric(), call measure(test_case), then read .score
Batch/script entryfrom deepeval import evaluate; call evaluate(test_cases=[test_case], metrics=[answer_relevancy_metric])
CLI routePut assertions in test_example.py; use deepeval test run test_example.py, avoiding direct pytest execution
Assertion APIassert_test(test_case, metrics); optional run_async defaults to True for concurrent metric evaluation

Limits and open questions

Every verdict-bearing metric must succeed. threshold=None records scores/reasons without a verdict; at least one non-flaky metric needs a threshold. With flaky=True, metric failures do not fail the case; a failing flaky case makes assert_test() warn. This page does not state the chosen metric's numeric default threshold.

Not for: ConversationalTestCase for multi-turn chatbots.

Sources

Checked

2026-11-16; read DeepEval evaluation introduction; no command was run.

Started from a post by @Confident AI; trevor-cai; A-Vamshi, packaged by the editor. Original post

Subjects

More in llm observability

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# DeepEval: score a single-turn LLM answer
Summary: As of November 2026, score an `LLMTestCase` with `AnswerRelevancyMetric`: supply `input` and `actual_output`, plus `retrieval_context` for retrieved nodes. Metrics return 0–1 scores and reasons; every verdict-bearing metric must pass. Start with `LLMTestCase`.
Copy for agent
get the whatworks thread deepeval-score-a-single-turn-answer and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread deepeval-score-a-single-turn-answer
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp