📍 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 AgentsTiming

Response Delay Consistency

Beta
Multi-turn
Referenceless
Chatbot
Voice

The response delay consistency metric checks whether your voice agent takes about the same time to answer every time, rather than replying instantly once and making the caller wait seconds the next. It returns the share of agent replies whose wait stays close to the agent's typical wait, between 0 and 1.

CallerAgent
0.0s / 27.3s

Required Arguments

To use the ResponseDelayConsistencyMetric, you'll have to provide a ConversationalTestCase with at least one of:

  • audio on the test case, a 16-bit stereo WAV recording of the whole call*
  • audio on the caller's and agent's turns, each with a start_time

Agent turns can also carry latency_ms, used with per-turn audio the same way as in Response Latency.

* Full call audio has to be a 16-bit stereo WAV, with the caller and agent on separate channels. Mono full call audio is ignored, because the two voices can't be told apart, and so is audio in any other format, such as MP3.

See How Is It Calculated for how each is used.

Usage

The ResponseDelayConsistencyMetric() 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 ResponseDelayConsistencyMetric
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 = ResponseDelayConsistencyMetric(threshold=0.8, max_shift_seconds=2)
evaluate(test_cases=test_cases, metrics=[metric])

There are TWO optional parameters specific to the ResponseDelayConsistencyMetric, on top of the common voice metric parameters:

  • [Optional] max_shift_seconds: an integer for how far, in seconds, a reply's wait may be from the agent's typical wait, slower or faster. Must be greater than 0. Defaulted to 2.
  • [Optional] use_speech_detection: a boolean which, when set to True, only counts the caller as talking when speech is detected, so background noise isn't mistaken for the caller and doesn't shorten or stretch a wait. With per-turn audio it's also used to find the agent's speech. Defaulted to True.

As a standalone

You can also run the ResponseDelayConsistencyMetric 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 whose wait broke from the usual shows up in score_breakdown. Here is what the example call returns:

{
    "eligible_turns": 4,
    "turns_with_events": 1,
    "events": [
        {
            "type": "delay_shift",
            "duration_seconds": 4.0,
            "start_time": 12.6,
            "mark": "range",
            "timing_source": "call_recording",
            "description": "Reply came 2.9s slower than usual",
            "reply_start": 16.6,
            "response_delay_seconds": 4.0,
            "shift_seconds": 2.9,
        }
    ],
    "skipped": [],
    "timing_source": "call_recording",
}
FieldWhat it means
reply_startWhen the reply started, in seconds into the call
response_delay_secondsHow long the caller waited for it
shift_secondsHow far that wait is from the typical wait. Negative when faster
start_timeWhere the wait begins: when the caller stopped talking
duration_secondsHow long the wait lasted, the same as response_delay_seconds

Every event also has the fields all voice events share, such as mark and description. Replies that couldn't be timed are listed under skipped with the reason. With per-turn audio, events and skipped entries carry turn, the index of the agent turn, instead of reply_start.

eligible_turns is how many agent replies were timed and turns_with_events how many broke from the usual wait. The score is the share that didn't.

How Is It Calculated?

The ResponseDelayConsistencyMetric score is calculated according to the following equation:

Response Delay Consistency=Number of Agent Replies Close to the Typical WaitTotal Number of Timed Agent Replies\text{Response Delay Consistency} = \frac{\text{Number of Agent Replies Close to the Typical Wait}}{\text{Total Number of Timed Agent Replies}}

With per-turn audio instead of full call audio, events carry the agent turn's index, turn, instead of reply_start.

Counting agent replies

Replies are found and their waits measured exactly as in Response Latency, for both audio formats, and the same replies are listed under skipped.

Consistency criteria

CallerAgent1.0 s1.2 s4.0 s1.1 s

The typical wait is the median of all the replies' waits, so one odd reply is flagged on its own instead of pulling the typical wait towards it. Above, the typical wait is 1.15 seconds, and only reply 3 is far from it.

CheckRule
ShiftMore than max_shift_seconds from the typical wait, 2 seconds by default, slower or faster
Replies neededAt least 3 timed replies. With fewer, there's no telling which one is off

With fewer, or nothing to count, the metric is skipped.

Example call

A call where the agent answers in about a second, except once. Each row is one agent reply, its wait, and how far that is from the typical wait.

CallerAgent0.8 s1.0 s4.0 s1.2 s0s5s10s15s20s
Agent replyWaitShift from 1.1 sFlagged?
3.2 s0.8 s−0.3 sNo
8.4 s1.0 s−0.1 sNo
16.6 s4.0 s+2.9 sYes
22.0 s1.2 s+0.1 sNo
4 replies1 flagged → 3/4 = 0.75

FAQs

Why is a fast reply flagged?
A reply that comes much faster than usual breaks the rhythm too, often because the agent answered before the caller had finished their thought.
How is this different from turn-taking naturalness?
TurnTakingNaturalnessMetric runs this metric together with response latency and both kinds of interruption, and scores the share of agent replies none of them flagged. This metric only points to the replies whose wait broke from the agent's usual rhythm.
Does this metric call an LLM or an external speech model?
No. It only reads when each speaker is talking, so it has no model or token cost. With use_speech_detection on, it runs the small Silero VAD model locally.

On this page