Failed Response
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.
Required Arguments
To use the FailedResponseMetric, you'll have to provide a ConversationalTestCase with:
contenton each turn, to tell which caller lines needed a replyaudioon the turns, withAudio.start_timeset 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 toTrue, 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 toTrue. - [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 toHumeDecisionModel().
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": [],
}| Field | What it means |
|---|---|
type | call_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 |
turn | The caller line's first turn, counting from 0. Unlike most voice metrics, this is a caller turn |
reply_turn | empty_reply only. The agent turn that was empty |
start_time | Where the caller line's speech ends, in seconds into the call |
duration_seconds | The 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:
The audio is only used to time the caller's turns, never to judge how they sound.
Counting caller lines
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
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.
| Check | Rule |
|---|---|
| Closes the call | The 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 |
| Answered | The 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.
| Caller line | What came next | Unanswered? |
|---|---|---|
| Turns 1–2, "Can you check my order" "number 4512?" | Agent reply in turn 3 | No |
| Turn 4, "Can I change the address?" | Turn 5, an agent turn with no text or audio | Yes (empty_reply) |
| Turn 6, "Hello? Can I change it?" | Agent reply in turn 7 | No |
| Turn 8, "Twelve Oak Street." | The call ended | Yes (call_ended_without_reply) |
| 4 caller lines | 2 unanswered → 2/4 = 0.5 |
FAQs
How is this different from agent responsiveness?
Why does Unexpected Call End fail too when the agent hangs up on a question?
Does this metric call an LLM or an external speech model?
"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.