Deepgram STTv2 using the Flux model for streaming speech-to-text.

This uses Deepgram's V2 API (/v2/listen) which provides turn-based transcription with support for preemptive generation.

Remarks

Key differences from STT (V1):

  • Uses TurnInfo events instead of SpeechStarted/Results
  • Supports eagerEotThreshold for preemptive LLM generation
  • Sends PREFLIGHT_TRANSCRIPT events when eager end-of-turn is detected

Example

import { STTv2 } from '@livekit/agents-plugin-deepgram';

const stt = new STTv2({
model: 'flux-general-en',
eagerEotThreshold: 0.5, // Enable preemptive generation
});

const stream = stt.stream();
stream.pushFrame(audioFrame);

for await (const event of stream) {
if (event.type === SpeechEventType.FINAL_TRANSCRIPT) {
console.log(event.alternatives?.[0]?.text);
}
}

Hierarchy (view full)

Constructors

Properties

label: "deepgram.STTv2" = 'deepgram.STTv2'

Accessors

  • get capabilities(): STTCapabilities
  • Returns this STT's capabilities

    Returns STTCapabilities

Methods

  • Returns Promise<void>

  • Receives an audio buffer and returns transcription in the form of a SpeechEvent

    Parameters

    Returns Promise<SpeechEvent>