Skip to content

bodhi-realtime-agent / DeepgramSTTProvider

Class: DeepgramSTTProvider

Defined in: transport/deepgram-stt-provider.ts:46

Streaming STT provider backed by Deepgram Nova-3 live transcription.

The provider accepts the framework's base64 PCM chunks, sends raw binary linear16 audio to Deepgram, and maps Deepgram Results messages onto the framework's partial/final transcript callbacks.

Implements

Constructors

Constructor

new DeepgramSTTProvider(config): DeepgramSTTProvider

Defined in: transport/deepgram-stt-provider.ts:70

Parameters

config

DeepgramSTTConfig

Returns

DeepgramSTTProvider

Properties

onPartialTranscript()?

optional onPartialTranscript: (text) => void

Defined in: transport/deepgram-stt-provider.ts:68

Partial/interim transcription (streaming providers only). Replaces any previous partial for the same turn.

Parameters

text

string

Returns

void

Implementation of

STTProvider.onPartialTranscript


onTranscript()?

optional onTranscript: (text, turnId) => void

Defined in: transport/deepgram-stt-provider.ts:67

Final transcription of user speech.

Parameters

text

string

The transcribed text.

turnId

The turn this transcript belongs to (from commit()). Undefined when a streaming provider's VAD auto-commits before the framework calls commit().

number | undefined

Returns

void

Implementation of

STTProvider.onTranscript

Methods

commit()

commit(turnId): void

Defined in: transport/deepgram-stt-provider.ts:140

Signal that the user's turn has ended (model started responding). For batch providers, this triggers transcription. For streaming providers, this may trigger a manual commit.

Parameters

turnId

number

Monotonically increasing turn counter for ordering.

Returns

void

Implementation of

STTProvider.commit


configure()

configure(audio): void

Defined in: transport/deepgram-stt-provider.ts:85

Configure the audio format that feedAudio() will deliver. Called once before start(). The provider MUST resample or reject if it cannot handle the given format.

Parameters

audio

STTAudioConfig

Returns

void

Implementation of

STTProvider.configure


feedAudio()

feedAudio(base64Pcm): void

Defined in: transport/deepgram-stt-provider.ts:130

Feed audio data. Format matches the STTAudioConfig from configure().

Parameters

base64Pcm

string

Base64-encoded PCM audio chunk.

Returns

void

Implementation of

STTProvider.feedAudio


handleInterrupted()

handleInterrupted(): void

Defined in: transport/deepgram-stt-provider.ts:147

Signal that the current turn was interrupted by the user. Providers MUST preserve buffered audio for the next commit().

Returns

void

Implementation of

STTProvider.handleInterrupted


handleTurnComplete()

handleTurnComplete(): void

Defined in: transport/deepgram-stt-provider.ts:151

Signal a natural turn completion (model finished, no interruption). Batch providers SHOULD clear buffers. Streaming providers may no-op.

Returns

void

Implementation of

STTProvider.handleTurnComplete


start()

start(): Promise<void>

Defined in: transport/deepgram-stt-provider.ts:100

Start the STT session (e.g. open WebSocket).

Returns

Promise<void>

Implementation of

STTProvider.start


stop()

stop(): Promise<void>

Defined in: transport/deepgram-stt-provider.ts:110

Stop the STT session (e.g. close WebSocket).

Returns

Promise<void>

Implementation of

STTProvider.stop

Built with VitePress