best-battery-56004
12/01/2025, 9:47 PMtall-airline-16756
12/01/2025, 9:47 PMtall-airline-16756
12/01/2025, 9:47 PMmax_endpointing_delay, default 6.0s) to give the user more time to finish speaking.
• Detect low-confidence transcriptions and prompt the user for confirmation, e.g., "I didn't catch that — could you repeat or clarify?" — implement this in your agent's dialog logic.
• Tune STT plugin thresholds (for example AssemblyAI's end_of_turn_confidence_threshold, default 0.7) so endpointing and turn detection better match your use case.
If you want, tell me which STT plugin you're using and whether you prefer automatic confirmation prompts or silent longer endpointing, and I’ll suggest specific setting values and a short confirmation prompt flow.
Sources: How does end-of-utterance detection work in conversations? | examples/frontdesk | livekit/livekit_composite | DeepWiki | AssemblyAI plugin guide | LiveKit Docsbest-battery-56004
12/01/2025, 9:49 PMtall-airline-16756
12/01/2025, 9:50 PMconfidence, end_of_turn_confidence, or similar field returned by the plugin).
• Define a threshold (common defaults: ~0.7). If score < threshold, mark the utterance as low-confidence.
• Optionally combine signals: low confidence + short utterance length, lots of filler words, or abrupt endpointing increases likelihood of error.
2) Adjust endpointing to reduce false positives
• Increase max_endpointing_delay (default 6.0s) to allow users to continue speaking before the agent finalizes the turn. This reduces premature low-confidence results.
3) Confirmation prompt strategies
• Explicit confirmation (recommended for critical actions):
◦ Agent asks: "I didn't catch that. Did you say: '<transcript>'?"
◦ If user confirms, proceed. If user denies, ask to repeat or offer multiple-choice clarifying options.
• Implicit confirmation (less intrusive):
◦ Agent repeats interpreted action: "Okay, I'll set a reminder for 3 PM." Wait for user correction within a short window.
• Clarification question for partial content:
◦ If only part is unclear, ask a focused question: "Do you mean tomorrow or Thursday?"
4) Minimal implementation flow (pseudocode)
• On transcription result:
a. If `confidence >= threshold`: proceed with normal handling.
b. Else:
• If automatic retries enabled: extend endpointing or request short reprompt (e.g., "Could you repeat that once?").
• Else send confirmation prompt: "I didn't catch that—did you mean '<transcript>'? (yes/no)"
• On "yes": accept. On "no": ask user to repeat or offer alternatives.
5) UX tips
• Use concise prompts and limit confirmations to important turns to avoid user frustration.
• For voice UX, allow simple affirmative/negative replies and small corrections (e.g., "No, 4 PM").
• Consider offering a confidence-aware fallback (e.g., display N-best alternatives in a UI when available).
If you tell me which STT plugin you use (AssemblyAI, Whisper, etc.) and whether you prefer explicit or implicit confirmations, I can suggest exact fields to check and a short prompt script tuned to that plugin.best-battery-56004
12/01/2025, 9:51 PMtall-airline-16756
12/01/2025, 9:51 PMtranscript and confidence field from your STT plugin,
• you can send TTS or text responses back to the user,
• you can control endpointing via max_endpointing_delay or re-open the turn (illustrated as a retry flag).
Example (Node.js / pseudocode style):
// Configuration
const CONFIDENCE_THRESHOLD = 0.7;
const MAX_RETRIES = 1; // allow one automatic retry before prompting
const RETRY_ENDPOINTING_DELAY = 2.0; // seconds to wait for user to continue after low-confidence
// State per active user/session
const sessionState = {
retriesLeft: MAX_RETRIES,
awaitingConfirmation: false,
lastTranscript: null,
};
// Called when the STT plugin returns a final transcription for a turn
async function onTranscription(session, result) {
// result: { transcript: string, confidence: number, end_of_turn: boolean }
const transcript = result.transcript.trim();
const confidence = result.confidence ?? 0;
sessionState.lastTranscript = transcript;
if (confidence >= CONFIDENCE_THRESHOLD) {
// High-confidence: proceed normally
await handleIntent(session, transcript);
resetSession(session);
return;
}
// Low-confidence branch
if (sessionState.retriesLeft > 0) {
// Ask to continue speaking by extending endpointing / giving a short retry window
sessionState.retriesLeft -= 1;
await sendTTS(session, "I missed that — you can continue speaking for a moment.");
// Here you would programmatically extend endpointing or set a short delay to accept more audio
await waitSeconds(RETRY_ENDPOINTING_DELAY);
// After delay, rely on subsequent transcription callback to re-enter onTranscription
return;
}
// No retries left: prompt for explicit confirmation
sessionState.awaitingConfirmation = true;
await sendTTS(session, `I didn't catch that clearly. Did you say: "${transcript}"? Please say Yes or No.`);
// Now wait for next user utterance which should be yes/no (handled in onUserReply)
}
// Called when user replies while awaiting confirmation
async function onUserReply(session, replyResult) {
// replyResult: { transcript: string, confidence: number }
const reply = replyResult.transcript.toLowerCase();
if (sessionState.awaitingConfirmation) {
if (reply.includes("yes") || reply.includes("correct") || reply.includes("yep")) {
// confirmed: proceed with last transcript
sessionState.awaitingConfirmation = false;
await sendTTS(session, "Great — I'll proceed.");
await handleIntent(session, sessionState.lastTranscript);
resetSession(session);
return;
}
if (reply.includes("no") || reply.includes("wrong") || reply.includes("nope")) {
// user denied: ask to repeat or offer clarifying choices
sessionState.awaitingConfirmation = false;
await sendTTS(session, "Sorry about that. Could you repeat that, or say the option you'd like?");
// Reset retries so we can allow another short retry
sessionState.retriesLeft = MAX_RETRIES;
return;
}
// If unclear yes/no, reprompt once
await sendTTS(session, "Please say Yes if that's correct, or No if it's not.");
return;
}
// Not awaiting confirmation: handle normally (could be a new command)
await onTranscription(session, replyResult);
}
// Helpers (stubbed)
function resetSession(session) {
sessionState.retriesLeft = MAX_RETRIES;
sessionState.awaitingConfirmation = false;
sessionState.lastTranscript = null;
}
async function handleIntent(session, transcript) {
// Replace with your intent handling / NLU flow
console.log("Handling intent for:", transcript);
await sendTTS(session, `Understood: ${transcript}`);
}
async function sendTTS(session, text) {
// Send TTS or text response to the user via LiveKit agent output
console.log("TTS ->", text);
}
function waitSeconds(sec) {
return new Promise(r => setTimeout(r, sec * 1000));
}
Notes and quick tips:
• Check the exact field names your STT plugin returns (confidence, end_of_turn_confidence, etc.) and use those in the code.
• For AssemblyAI-like plugins, you can also inspect end_of_turn_confidence and tune end_of_turn_confidence_threshold.
• Keep confirmation prompts short and only use explicit confirmation for critical actions to avoid annoying users.
• Consider offering an N-best list (if your STT provides alternatives) in the confirmation ("Did you mean A, B, or C?").
Would you like this adapted to a specific STT plugin (AssemblyAI, Whisper, etc.) or to a different language/framework?