Reprompt
The reprompt metric checks whether the caller had to speak again before your voice agent replied, as in "Can you check my order?" followed by "Hello? Are you there?". It finds likely repeats from the call's timing, then asks a decision model whether each one is real. It returns the share of caller lines the agent answered without being prompted again, between 0 and 1.
Required Arguments
To use the RepromptMetric, you'll have to provide a ConversationalTestCase with:
contenton each turn, which the decision model readsaudioon the turns, withAudio.start_timeset so the wait before a repeat can be measured. A line whose wait can't be measured is never flagged
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 RepromptMetric() 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 RepromptMetric
from deepeval.simulator import ConversationSimulator
from deepeval.voice import ElevenLabsConnector, VoiceConfig
golden = ConversationalGolden(
scenario="The user asks a question that requires the agent to look up an account.",
expected_outcome="The agent answers without the user having to repeat themselves.",
)
simulator = ConversationSimulator(
voice_config=VoiceConfig(
connector=ElevenLabsConnector(agent_id="your-agent-id"),
)
)
test_cases = simulator.simulate([golden])
metric = RepromptMetric(threshold=0.8)
evaluate(test_cases=test_cases, metrics=[metric])There are TWO optional parameters specific to the RepromptMetric, on top of the common voice metric parameters:
- [Optional]
system_one_model: the Jev decision model that decides whether each likely repeat is real, as a string or aDeepEvalBaseSystemOneModel. Reprompt has noeval_modeand ignores both eval mode settings: it always uses the model, but only when the call has a likely repeat. The model is built the first time it's needed, so creating the metric needs no TypeSafe AI key. Defaulted tojev-latest. - [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 how long the caller waited. Defaulted toTrue.
As a standalone
You can also run the RepromptMetric 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 the caller had to repeat shows up in score_breakdown. Here is what the example call returns:
{
"eligible_turns": 6,
"turns_with_events": 1,
"events": [
{
"type": "user_reprompted",
"turn": 1,
"duration_seconds": 6.24,
"start_time": 4.76,
"mark": "range",
"timing_source": "turn_timestamps",
"description": "Caller repeated themselves after 6.2s",
"reprompt_turn": 2,
}
],
"skipped": [],
}| Field | What it means |
|---|---|
turn | The first turn of the caller line that wasn't answered in time, counting from 0. Unlike most voice metrics, this is a caller turn |
reprompt_turn | The caller turn that came straight after, where they spoke again |
start_time | Where the caller line's speech ends, in seconds into the call |
duration_seconds | How long the caller waited in silence before speaking again |
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 had to be repeated. The score is the share that didn't.
How Is It Calculated?
The RepromptMetric 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, which isn't the caller speaking again. 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. Lines that close the call, ending in "bye", "goodbye", "thank you", "thanks", "that's all" or "that is all", aren't counted.
Reprompt criteria
A caller line is a likely repeat when the caller's very next turn starts a new line and the agent replies later in the call. Each likely repeat then goes to a decision model, which reads:
- the agent's line before it,
- the caller's line,
- how long the caller waited, and
- what the caller said next.
It answers one question: does the next line only repeat the line, or check that someone is still there, without adding anything new? If yes, the line counts as repeated. A caller who adds something new isn't repeating, even if they start by saying the line again: more detail, the rest of an unfinished sentence, a different answer, thanks or a goodbye. Nor is a caller who says something unrelated or talks to someone else.
| Check | Rule |
|---|---|
| Waited | At least 2.5 seconds of silence from the end of the line's speech to the start of the next line's. A shorter pause is the caller still talking. Both turns need an Audio.start_time, or the wait isn't known and the line isn't flagged |
| Not just a greeting | When the next line is only a greeting, such as "hi", "hello", "hey" or "hello there", the wait must be at least 4 seconds |
| Not an echo | Neither the line nor the next line is mostly the agent's own words. A line with 3 or more words, at least 80% of them in the agent's line before it, is the agent's voice echoing on the caller's line |
| Answered later | An agent turn comes later in the call. A line never answered at all is left to Failed Response |
| Really a repeat | The decision model says yes, with a probability of 0.5 or more |
All the likely repeats in a call go to the model in one request. If it returns no answer for one of them, the metric raises an error instead of guessing. If no turn has audio, or no caller line needed a reply, the metric is skipped.
Example call
The caller speaks again three times before the agent replies, but only one of those is because they were kept waiting. Each row is one caller line and whether the caller had to repeat it.
| Caller line | What came next | Repeated? |
|---|---|---|
| Turn 1, "Can I pay my bill?" | "Hello? Are you there?" after 6.2 s. The model says it's a repeat | Yes |
| Turn 2, "Hello? Are you there?" | Agent reply | No |
| Turn 4, "Which card is on file?" | "The Visa, I mean." after under 2 s | No |
| Turn 5, "The Visa, I mean." | Agent reply | No |
| Turn 7, "And my rewards balance?" | "Oh, and my savings too." after 5.2 s. The model says it's something new | No |
| Turn 8, "Oh, and my savings too." | Agent reply | No |
| Turn 10, "Thanks, bye." | Closes the call, so not counted | |
| 6 caller lines | 1 repeated → 5/6 = 0.83 |
FAQs
How is this different from failed response?
Does this metric call an LLM or an external model?
evaluation_cost, and the model's name is on evaluation_model.Why does a caller who just keeps talking not count?
My agent pauses to call a tool and the caller gets marked as repeating themselves.
turn_detection="patient" on your connector so the simulator waits through mid-reply pauses instead of prompting again.