calm-train-17221
08/04/2025, 5:14 AMtall-airline-16756
08/04/2025, 5:14 AMtall-airline-16756
08/04/2025, 5:15 AMmin_confidence_threshold).
• Speechmatics, Baseten, and AssemblyAI: Provide confidence values, but handling low-confidence results would need to be implemented in your application logic.
You can configure your application to ask users to repeat themselves when the confidence value is below a certain threshold. Let me know if you need help setting this up!
Sources: livekit-plugins/livekit-plugins-assemblyai/livekit/plugins/assemblyai/stt.p... | AssemblyAI integration guide | LiveKit Docscalm-train-17221
08/04/2025, 5:17 AMtall-airline-16756
08/04/2025, 5:17 AMfrom livekit.plugins import assemblyai
# Initialize AssemblyAI STT with confidence threshold
stt = assemblyai.STT(
end_of_turn_confidence_threshold=0.8,
min_end_of_turn_silence_when_confident=160,
max_turn_silence=2400,
)
1. Listen for Transcription Events: Use the SpeechEvent to catch those transcriptions and check their confidence levels.
async def on_transcript(event: SpeechEvent):
if event.type == SpeechEventType.FINAL_TRANSCRIPT:
confidence = event.alternatives[0].confidence
transcript = event.alternatives[0].text
if confidence >= 0.8:
# Trigger action based on high confidence
trigger_action(transcript)
# Set up event listener
stt.on('SpeechEventType.FINAL_TRANSCRIPT', on_transcript)
1. Trigger Actions Based on Confidence: Here’s where you decide what happens when the confidence hits your threshold. Just plug in your action logic:
def trigger_action(transcript: str) -> None:
# Implement your action logic here
print(f"Triggering action with transcript: {transcript}")
If you have any questions or want a hand with the setup, just let me know—I’m here to help!