is diarization available for deepgram plugin?
# ask-ai
n
is diarization available for deepgram plugin?
t
Thanks for reaching out, Kaster. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Diarization is supported in the Deepgram plugin for LiveKit. You can enable it by setting the
diarize
parameter to
true
within your Deepgram STT options. In JavaScript, for example:
Copy code
const sttOptions = {
  diarize: true,
  // other options...
};
When enabled, this parameter is passed to Deepgram's API and allows the system to distinguish between different speakers. By default,
diarize
is set to
false
. Sources: af144a41-2c4c-4189-9810-c602682aa05e, ec3eed99-8a8c-43e5-8e45-f2058270ce02 Sources: STTOptions | LiveKit Agents | plugins/deepgram/src/stt.ts | Speechmatics integration guide | LiveKit Docs
n
but i'm getting
Copy code
TypeError: STT.__init__() got an unexpected keyword argument 'diarize'
error when supplying that parameter to deepgram plugin
t
Hey there! I totally understand the frustration with that tricky error you're seeing. So, the Deepgram STT plugin in the LiveKit Python SDK doesn't support the
diarize
parameter right now - it's a bit of a bummer, I know. The good news? There's a workaround! If you want speaker diarization in Python, the Speechmatics plugin is your new best friend. It supports diarization super easily with
diarization="speaker"
. Check out this handy example:
Copy code
from livekit.plugins import speechmatics

stt = speechmatics.STT(
    transcription_config=speechmatics.types.TranscriptionConfig(
        language="en",
        operating_point="enhanced",
        enable_partials=True,
        max_delay=0.7,
        diarization="speaker",
        speaker_diarization_config={"max_speakers": 2},  # adjust as needed
    )
)
This setup will give you speaker IDs in your transcription results - pretty cool, right? If you're really set on using Deepgram with diarization, just know that it's currently only available in Node.js. Alternatively, you could process responses directly from Deepgram's API outside the plugin. Sources: a5510711-aef0-484b-8bfb-226a6ac9f504, af144a41-2c4c-4189-9810-c602682aa05e, ec3eed99-8a8c-43e5-8e45-f2058270ce02, 031f2f9f-650a-46f6-af89-81bdd9caeed0, cd233cca-5f12-40c4-96ef-c1295379410c Sources: livekit-plugins/livekit-plugins-gladia/livekit/plugins/gladia/stt.py | plugins/deepgram/src/stt.ts | STTOptions | LiveKit Agents | Deepgram STT integration guide | LiveKit Docs | pipeline-stt/diarization.py