echoing-lamp-18687
02/24/2026, 6:10 AMtall-airline-16756
02/24/2026, 6:11 AMtall-airline-16756
02/24/2026, 6:11 AMuser_input_transcribed, or via a plugin API response stored elsewhere?
• Do you need the confidence for a live/user input transcript (real-time) or for post-processed transcripts?
What I can say now:
• Some STT plugins (Deepgram, AssemblyAI) expose confidence metrics internally and use confidence thresholds for end-of-turn detection.
• The LiveKit recipe/events like user_input_transcribed can be used to receive transcription results, but the documentation does not explicitly state whether the event payload includes a confidence score.
Next steps I can take for you:
• If you tell me the plugin and how you currently receive transcripts, I will outline the exact places to look for a confidence field (event payload vs plugin response) and show a small example of extracting it.
• If your current plugin doesn’t return confidence, I can suggest alternatives: either switching to a plugin that provides confidence or calling the STT provider’s API directly to get confidence scores.
Pick one of the options above (answer the three questions or tell me which next step you prefer) and I’ll give the exact code/event examples to extract the confidence value.
Sources: Deepgram STT plugin guide | LiveKit Documentation | AssemblyAI plugin guide | LiveKit Documentation | Interrupt User | LiveKit Documentationechoing-lamp-18687
02/24/2026, 6:12 AMtall-airline-16756
02/24/2026, 6:12 AMuser_input_transcribed event or when processing the SpeechStream from the Deepgram plugin). You should read the alternatives array on the event and extract the confidence from the chosen alternative.
Two concise examples you can use
1) Listening to LiveKit transcription events (Python-style pseudocode)
• This shows extracting confidence from the event payload when LiveKit emits user_input_transcribed.
@session.on("user_input_transcribed")
def on_transcript(transcript):
# Only proceed if we have alternatives
if transcript.alternatives:
# Choose the primary alternative (index 0)
alt = transcript.alternatives[0]
text = alt.text
confidence = alt.confidence
print(f"Transcript: {text} Confidence: {confidence}")
2) Handling Deepgram SpeechStream directly (async streaming)
• If you are consuming the Deepgram stream yourself, check each event for alternatives and confidence.
async def recognize_task(stream: deepgram.SpeechStream):
async for event in stream:
if event.alternatives:
alt = event.alternatives[0]
final_text = alt.text
confidence = alt.confidence
if event.is_final:
print(f"Final transcript: {final_text} (confidence={confidence})")
else:
print(f"Interim transcript: {final_text} (confidence={confidence})")
Notes and tips
• Alternatives: Many responses contain multiple alternatives. Use whichever alternative makes sense (commonly the first).
• Interim vs final: You’ll receive interim events with confidence as well — typically use the final event for production decisions.
• Thresholding: If you want to filter low-confidence transcripts, compare the confidence to your threshold (for example, 0.7) before creating a chat message or taking an action.
• End-of-turn logic: Deepgram and LiveKit may use confidence thresholds (e.g., eager_eot_threshold or end_of_turn_confidence_threshold) internally to decide end-of-turn; those are separate and configurable if you need different behavior.
If you want, tell me:
• Whether you want sample code for another language (Node, Go, etc.), or
• Where you’re consuming transcripts (event handler vs plugin callback) and I’ll give a tailored snippet for that setup. Sources: Deepgram STT plugin guide | LiveKit Documentation | An open source stack for real-time multimodal AI | An open source stack for real-time multimodal AI