📍 Join the 1st DeepEval meetup in SF, this Friday 5pm PT. RSVP on Luma →
💥 Introducing JevEval: Jev-as-a-Judge for LLM evaluation. Read the post →
Voice AgentsResponsiveness

Failed Response

Beta
Multi-turn
Referenceless
Chatbot
Voice

The failed response metric checks whether your voice agent answered every caller line that needed an answer, instead of replying with nothing or letting the call end. It returns the share of caller lines that got a reply, between 0 and 1.

CallerAgent
0.0s / 7.3s

Required Arguments

To use the FailedResponseMetric, you'll have to provide a ConversationalTestCase with:

  • content on each turn, to tell which caller lines needed a reply
  • audio on the turns, with Audio.start_time set so caller turns can be placed on the call's clock

A stereo recording on the test case isn't enough: the metric matches each transcript line to its turn's audio, so without per-turn audio it's skipped and says why.

Usage

The FailedResponseMetric() can be used for end-to-end evaluation of voice calls, such as ones produced by the ConversationSimulator in voice mode:

from deepeval import evaluate
from deepeval.dataset import ConversationalGolden
from deepeval.metrics import FailedResponseMetric
from deepeval.simulator import ConversationSimulator
from deepeval.voice import ElevenLabsConnector, VoiceConfig


golden = ConversationalGolden(
    scenario="The user asks the agent to look up an order by its number.",
    expected_outcome="The agent reads back the order status.",
)

simulator = ConversationSimulator(
    voice_config=VoiceConfig(
        connector=ElevenLabsConnector(agent_id="your-agent-id"),
    )
)
test_cases = simulator.simulate([golden])

metric = FailedResponseMetric(threshold=1.0)
evaluate(test_cases=test_cases, metrics=[metric])

There are THREE optional parameters specific to the FailedResponseMetric, on top of the common voice metric parameters:

  • [Optional] use_speech_detection: a boolean which when set to True, finds where the speech is inside each turn's clip with speech detection, so silence or noise at a clip's edges isn't counted as speaking. It decides which caller turns join into one line, and where the silence after a line starts. Defaulted to True.
  • [Optional] eval_mode: "deterministic" or "hybrid". In "hybrid", each unanswered caller line is double-checked by an audio decision model before it counts. Defaulted to the configured voice eval mode ("deterministic" unless set).
  • [Optional] audio_decision_model: the model that does the second check in "hybrid" mode. Defaulted to HumeDecisionModel().

As a standalone

You can also run the FailedResponseMetric on a single test case as a standalone, one-off execution:

metric.measure(test_cases[0])

print(metric.score, metric.reason)
print(metric.score_breakdown)

See Events for what score_breakdown contains.

Events

Each caller line that went unanswered shows up in score_breakdown. Here is what the example call returns:

{
    "eligible_turns": 4,
    "turns_with_events": 2,
    "events": [
        {
            "type": "empty_reply",
            "turn": 4,
            "duration_seconds": 2.74,
            "start_time": 12.26,
            "mark": "range",
            "timing_source": "turn_timestamps",
            "description": "Agent's reply was empty",
            "reply_turn": 5,
        },
        {
            "type": "call_ended_without_reply",
            "turn": 8,
            "duration_seconds": 0.24,
            "start_time": 22.76,
            "mark": "range",
            "timing_source": "turn_timestamps",
            "description": "Call ended without a reply",
        },
    ],
    "skipped": [],
}
FieldWhat it means
typecall_ended_without_reply if no agent turn came after the line, empty_reply if the agent's next turn had no text and no audio
turnThe caller line's first turn, counting from 0. Unlike most voice metrics, this is a caller turn
reply_turnempty_reply only. The agent turn that was empty
start_timeWhere the caller line's speech ends, in seconds into the call
duration_secondsThe silence after it: up to where the next turn's speech starts, or to the end of the call's last audio

start_time and duration_seconds are missing when the line's last turn has no Audio.start_time.

Every event also has the fields all voice events share, such as mark and description.

eligible_turns is how many caller lines needed a reply and turns_with_events how many went unanswered. The score is the share that were answered.

How Is It Calculated?

The FailedResponseMetric score is calculated according to the following equation:

Failed Response=Number of Caller Lines AnsweredTotal Number of Caller Lines That Needed a Reply\text{Failed Response} = \frac{\text{Number of Caller Lines Answered}}{\text{Total Number of Caller Lines That Needed a Reply}}

The audio is only used to time the caller's turns, never to judge how they sound.

Counting caller lines

Callerturn 0turn 1Agentline 1line 20s2s4s6s8s10s

A transcriber often splits one sentence into several turns. Caller turns in a row are one line when the next one's speech starts less than 1 second after the previous one's speech ends, as with turns 0 and 1 above. The metric listens inside each clip for where the speech starts and stops. A turn without an Audio.start_time can't be timed, so it is always a line of its own.

Reply criteria

CallerAgentansweredcall ended0s2s4s6s8s

A caller line needs a reply unless it closes the call. It is unanswered when:

  • no agent turn comes after it before the call ends, or
  • the agent's next turn has no text and no audio.

Several caller lines in a row share the agent's next reply, so if the call ends after them, each one is unanswered.

CheckRule
Closes the callThe text of the line's last turn ends in "bye", "goodbye", "thank you", "thanks", "that's all" or "that is all", ignoring trailing periods and exclamation marks
AnsweredThe agent's next turn after the line has text or audio. Only that turn counts: a later agent turn doesn't make up for an empty one

A reply only has to exist. Whether it could be heard is checked by Silent Reply, and how long it took by Response Latency. If no turn has audio, or no caller line needed a reply, the metric is skipped.

Second check

In the hybrid eval mode, each unanswered caller line is double-checked before it counts. The audio decision model hears the agent's side of the call through the silence after the line, widened to 5 seconds when it's shorter, and is asked:

Does the AI agent stay silent here instead of answering?

If the model judges "no" more likely than "yes", the line is dismissed and doesn't count against the score. Without stereo full call audio there's usually no agent audio around the line to hear, so the line still counts.

Example call

A caller asks about an order, but the agent sends one empty reply, and the call ends before the agent answers the last line. Each row is one caller line and whether the agent answered it.

Callerturn 1turn 4turn 6turn 8Agentturn 0turn 3turn 7empty replycall ended0s5s10s15s20s
Caller lineWhat came nextUnanswered?
Turns 1–2, "Can you check my order" "number 4512?"Agent reply in turn 3No
Turn 4, "Can I change the address?"Turn 5, an agent turn with no text or audioYes (empty_reply)
Turn 6, "Hello? Can I change it?"Agent reply in turn 7No
Turn 8, "Twelve Oak Street."The call endedYes (call_ended_without_reply)
4 caller lines2 unanswered → 2/4 = 0.5

FAQs

How is this different from agent responsiveness?
AgentResponsivenessMetric runs this metric together with silent replies, unexpected call ends and reprompts, and scores the share of exchanges none of them flagged. This metric checks only whether each caller line got a reply, and points to the lines that didn't.
Why does Unexpected Call End fail too when the agent hangs up on a question?
They report two sides of one failure. This metric reports the unanswered question, and UnexpectedCallEndMetric reports how the call ended.
Does this metric call an LLM or an external speech model?
Not by default. It reads the order of the turns, their text and the timing of their audio, so it has no model or token cost. In the "hybrid" eval mode, each unanswered line is also checked by an audio decision model, at one paid request per line. With use_speech_detection on, the small Silero VAD model runs locally over each clip.
Does it judge the caller's audio?
No. It reads the text of the caller's lines to know whether each one needed a reply, and the timing of their audio to join turns into lines. How the caller sounds is never judged.

On this page