I'm using LiveKit agents with AgentSession and ...
# ask-ai
j
I'm using LiveKit agents with AgentSession and Deepgram STT. The automatic TranscriptSynchronizer is sending multiple transcripts for a single user utterance (e.g., 'Hello there.' then 'Hello there. Can you' then 'Hello there. Can you hear me?'). How can I configure either: 1. Deepgram STT to only send truly final transcripts (not incremental ones marked as final) 2. OR the TranscriptSynchronizer to buffer/deduplicate transcripts before sending 3. OR properly use the conversation_item_added event to intercept and control transcript forwarding I'm seeing duplicate Communication resources being created in my app because each incremental transcript is being sent as a separate text stream message.
t
Thanks for reaching out, Albert. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
To address the issue of multiple transcripts being sent for a single user utterance, you can configure Deepgram STT to send only truly final transcripts by disabling interim results. Here's how you can do this: Python Configuration:
Copy code
from livekit.plugins.deepgram import STT

deepgram_stt = STT(
    model="nova-3",
    interim_results=False,  # Disable interim results
    endpointing_ms=25,      # Control silence detection
    punctuate=True,
    smart_format=True,
    language="en-US"
)
JavaScript Configuration:
Copy code
import { STT } from '@livekit/agents-plugin-deepgram';

const deepgramSTT = new STT({
    interimResults: false,  // Disable interim results
    endpointing: 25,        // Control silence detection
    punctuate: true,
    smartFormat: true,
    language: 'en-US'
});
By setting
interim_results
(Python) or
interimResults
(JavaScript) to
false
, the system will only emit final transcripts and skip interim ones. Additionally, you can configure the
endpointing_ms
parameter to control when speech is considered ended. For example: •
endpointing_ms
: Time in milliseconds of silence to consider end of speech. Set to 0 to disable. Defaults to 25. •
punctuate
: Whether to add punctuations to the transcription. •
smart_format
: Whether to apply smart formatting to numbers, dates, etc. Regarding the TranscriptSynchronizer, I couldn't find specific details about its ability to buffer or deduplicate transcripts. If you need further assistance with this component or using the
conversation_item_added
event to intercept and control transcript forwarding, please let me know, and I can escalate this to a specialist for more detailed guidance. Sources: livekit-plugins/livekit-plugins-aws/livekit/plugins/aws/stt.py | plugins/deepgram/src/stt.ts