Abrupt Cut-off
The abrupt cut-off metric checks whether your voice agent's replies stop mid-sound, as in "Your balance is two hundred and" followed by nothing. It returns the share of agent replies that end cleanly, between 0 and 1.
Required Arguments
To use the AbruptCutoffMetric, you'll have to provide a ConversationalTestCase with audio on the test case as a stereo recording of the whole call*, or audio on the agent's turns.
When the test case has full call audio, it's used even if the turns have audio too. With per-turn audio only, give every clip an Audio.start_time, or stream cuts can't be found.
* Full call audio has to be stereo, with the caller and agent on separate channels. Mono full call audio is ignored, because the two voices can't be told apart.
Usage
The AbruptCutoffMetric() 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 AbruptCutoffMetric
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 = AbruptCutoffMetric(threshold=0.8)
evaluate(test_cases=test_cases, metrics=[metric])There are THREE optional parameters specific to the AbruptCutoffMetric, on top of the common voice metric parameters:
- [Optional]
use_speech_detection: a boolean which when set toTrue, only counts the caller as talking when speech is detected on their channel, so background noise doesn't excuse a cut-off. It also helps find the dead streams that excuse a stop. Defaulted toTrue. - [Optional]
eval_mode:"deterministic"or"hybrid". In"hybrid", each cut-off 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 AbruptCutoffMetric 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 reply that was cut off shows up in score_breakdown as one event. Here is what the example call, read from full call audio, returns:
{
"eligible_turns": 4,
"turns_with_events": 1,
"events": [
{
"type": "abrupt_cutoff",
"duration_seconds": 0.02,
"start_time": 11.58,
"mark": "moment",
"timing_source": "call_recording",
"description": "Agent's audio cut off abruptly",
"reply_start": 10.0,
"stopped_at_seconds": 11.6,
}
],
"skipped": [],
"timing_source": "call_recording",
}| Field | What it means |
|---|---|
reply_start | When the cut reply started, in seconds into the call |
stopped_at_seconds | When its sound stopped |
start_time | Where the 20 ms checked before the stop begins |
duration_seconds | Always 0.02: the 20 ms that were checked |
With per-turn audio, events name the turn and where in its clip the cut happened. A cut at the end of a clip has type "abrupt_cutoff", and a stream cut has type "stream_cut". In this call, the agent's turn 1 stops mid-word and turn 2 picks up 0.5 seconds later:
{
"eligible_turns": 4,
"turns_with_events": 1,
"events": [
{
"type": "stream_cut",
"turn": 1,
"role": "assistant",
"offset_seconds": 1.125,
"duration_seconds": 0.0,
"start_time": 4.625,
"mark": "moment",
"timing_source": "turn_timestamps",
"description": "Agent's audio cut off abruptly",
"position": "end",
"evidence": "abrupt_end",
"gap_seconds": 0.5,
"resumed_turn": 2,
}
],
"skipped": [],
"timing_source": "turn_timestamps",
}| Field | What it means |
|---|---|
offset_seconds | For abrupt_cutoff, where the 20 ms checked before the stop begins, in seconds from the start of the clip. For stream_cut, where the clip stops or its dead air begins |
duration_seconds | 0.02 for abrupt_cutoff, 0 for stream_cut |
evidence | Why a stream cut counts: "abrupt_end" when the clip stops mid-sound, "trailing_dead_run" when it ends in dead air |
gap_seconds | How long after the clip ended the agent's next clip started |
resumed_turn | The turn where the agent picked back up |
role, position | On stream cuts only: whose turn it is, and whether the cut is near the start, middle or end of the clip |
Clips that can't be decoded are listed under skipped. Every event also has the fields all voice events share, such as mark and description.
eligible_turns is how many agent replies were counted and turns_with_events how many were cut off. The score is the share that weren't.
How Is It Calculated?
The AbruptCutoffMetric score is calculated according to the following equation:
Counting agent replies
With full call audio, each reply is a timed reply, so a pause under 1 second doesn't end it: reply 1 above is one reply even though the agent paused mid-way. With per-turn audio, each agent clip that decodes is one reply. A reply counts as cut off at most once.
Cut-off criteria
A finished reply fades out. A cut one stops at near full volume.
Only the stop at the very end of each reply, within 0.05 seconds of it, is checked, not stops mid-reply. The reply is flagged if that stop is a cut-off, except when:
- the caller made 0.2 seconds or more of sound from 1 second before it to 0.2 seconds after, or
- the full call audio ends within 0.05 seconds, which Unexpected Call End judges instead.
A stop is a cut-off when the last 20 ms of sound before it are:
| Check | Rule |
|---|---|
| Still at speech volume | At least 80% of the median level of the second before |
| Above the background | More than 10 dB above the background noise. With per-turn audio, only checked on clips of 2 seconds or more |
| Not quiet residue | Above about −30 dBFS |
Even then, a stop isn't a cut-off when:
- the text of the agent's reply ends a sentence, with
.,?,!or…. The reply was said in full, however sharply its last sound stops. With full call audio, the text is that of the agent turn whose clip the stop falls in, so this only applies when the turns also have audio with anAudio.start_time. With full call audio alone it isn't checked. - a dead stream starts within 0.3 seconds of the stop. The agent's audio went dead and then carried on, so it's a hole in the reply for Dead Stream to judge.
If there's nothing to count, the metric is skipped.
Per-turn audio
Without full call audio, only the end of each agent clip is checked, with the same level rules. Otherwise:
- The caller check and the end-of-call check need full call audio, so they don't apply. Instead, a clip with
interrupted=Trueis never flagged. - The text checked for a finished sentence is the turn's own
content. - A clip is also flagged as a stream cut when it ends mid-sound, or in 1 second or more of digital silence, and the agent's own clip is next on the call, starting within 15 seconds. This needs an
Audio.start_timeon every clip. - A cut isn't flagged when a dead stream starts within 0.3 seconds of it, as above. This also needs the clip's
Audio.start_time.
Second check
In the hybrid eval mode, each cut-off is double-checked before it counts. The audio decision model hears about 5 seconds of the agent's side of the call around it and is asked:
Does the speaker's voice cut off abruptly, mid-word or mid-sentence?
If the model judges "no" more likely than "yes", the cut-off is dismissed and doesn't count against the score.
Example call
A short call where the agent sometimes stops mid-word.
| Agent reply | How it ends | Cut off? |
|---|---|---|
| 2.8 – 5.0 s | Fades out | No |
| 6.3 – 7.9 s | Full volume, but the caller was talking | No |
| 10.0 – 11.6 s | Full volume, caller silent, and the reply's text stops mid-sentence | Yes |
| 13.2 – 14.0 s | Still going when the full call audio ends | No |
| 4 replies | 1 cut off → 3/4 = 0.75 |
FAQs
Why isn't a reply the simulated caller interrupted flagged?
interrupted=True and count as clean replies. With full call audio, the caller is heard speaking up, which excuses the stop too.How is this different from Dead Stream?
Does this metric call an LLM or an external speech model?
"hybrid" eval mode, each cut-off is also checked by an audio decision model, at one paid request per cut-off.