📍 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

Time to First Response

Beta
Multi-turn
Referenceless
Chatbot
Voice

The time to first response metric checks whether your voice agent greets the caller promptly once the call connects, rather than leaving the line silent. It returns 1 when the first response came in time and 0 when it didn't.

CallerAgent
0.0s / 10.8s

Required Arguments

To use the TimeToFirstResponseMetric, 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 turns, each with a start_time in seconds since the call connected

* 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.

When the test case has full call audio, it's used and the turns' audio is ignored. See How Is It Calculated for how each is used.

Usage

The TimeToFirstResponseMetric() 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 TimeToFirstResponseMetric
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 = TimeToFirstResponseMetric(max_wait_seconds=3)
evaluate(test_cases=test_cases, metrics=[metric])

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

  • [Optional] max_wait_seconds: an integer for the longest wait, in seconds, before the agent's first response. Must be greater than 0. Defaulted to 3.
  • [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's first words. On the agent's side, any sound counts as the first response. Defaulted to True.

As a standalone

You can also run the TimeToFirstResponseMetric 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

A slow first response shows up in score_breakdown. Here is what the example call returns:

{
    "eligible_turns": 1,
    "turns_with_events": 1,
    "events": [
        {
            "type": "slow_first_response",
            "duration_seconds": 3.4,
            "start_time": 1.6,
            "mark": "range",
            "timing_source": "call_recording",
            "description": "Agent took 3.4s to first respond",
            "reply_start": 5.0,
            "first_response_seconds": 3.4,
        }
    ],
    "skipped": [],
    "timing_source": "call_recording",
}
FieldWhat it means
reply_startWhen the agent first made sound, in seconds into the call
first_response_secondsHow long the wait was
start_timeWhere the wait begins: the start of the call, or the end of the caller's first words. Always 0 with per-turn audio
duration_secondsHow long the wait lasted, the same as first_response_seconds

Every event also has the fields all voice events share, such as mark and description. With per-turn audio, the event carries turn, the index of the greeting's turn, instead of reply_start.

eligible_turns is always 1, the agent's first response, and turns_with_events is 1 when it was slow, which makes the score 0.

How Is It Calculated?

The TimeToFirstResponseMetric score is calculated according to the following equation:

Time to First Response={1if the first response starts within the wait limit0otherwise\text{Time to First Response} = \begin{cases} 1 & \text{if the first response starts within the wait limit} \\ 0 & \text{otherwise} \end{cases}

With per-turn audio instead of full call audio, the first response is the agent's first sound in any of its clips, placed on the call's clock by its Audio.start_time. The wait always runs from 0 on that clock, which is taken as the moment the call connected, to that first sound, so an agent clip with start_time=4.0 that starts with sound is a 4-second wait. Who spoke first doesn't move the start of the wait: if the caller's speech starts before the agent's first sound, the metric is skipped instead. The event carries the greeting's turn, turn, instead of reply_start.

Finding the first response

CallerAgentfirst soundwait0s2s4s6s

With full call audio, the first response is the agent's first sound on its channel, and the wait depends on who spoke first:

  • The agent speaks first: from the start of the full call audio to the agent's first sound.
  • The caller speaks first, within max_wait_seconds: from the end of the caller's first words to the agent's first sound, or 0 if the agent starts before those words end. Pauses under 0.5 seconds don't end the first words, as in the diagram above.
  • The caller speaks first, but only after more than max_wait_seconds: the caller waited in silence for a greeting that never came. The wait runs from the start of the full call audio to the caller's first words, so it's always too long.

Wait criteria

CheckRule
WaitMore than max_wait_seconds, 3 seconds by default

The metric is skipped when the agent makes no sound in the full call audio, or, with per-turn audio, when the call has no timed audio, an audio turn has no start_time, or the caller speaks first, since the agent then wasn't expected to greet.

Example call

A call with a slow start, where the caller says hello first.

CallerAgenthelloslow3.4 s0s2s4s6s8s10s12s14s
First responseWaitSlow?
5.0 s, after the caller's hello ended at 1.6 s3.4 sYes
1 responseslow → 0

FAQs

Why is my call skipped when the caller speaks first?
With per-turn audio, a caller who speaks first means the agent wasn't expected to greet, so there's nothing to time. ResponseLatencyMetric times the agent's answer instead. With full call audio, the wait is timed from the end of the caller's first words instead, as long as they spoke within max_wait_seconds of the call connecting.
How is this different from turn-taking naturalness?
TurnTakingNaturalnessMetric doesn't look at how the call opens. This metric only checks the silence before the agent's first word.
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