Added deepgram flux plugin #938
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Implemented Deepgram STTv2 support to enable usage of the new Flux model (
flux-general-en). This implementation maintains parity with the Python SDK, introducing support for turn-based transcription and preemptive generation viaeagerEotThreshold.Python Implementation : livekit/agents#3245
closes #771
Changes Made
plugins/deepgram/src/stt_v2.ts: Complete implementation ofSTTv2class andSpeechStreamv2using Deepgram's V2 WebSocket API.plugins/deepgram/src/index.ts: ExportedSTTv2andSTTv2Options.plugins/deepgram/src/stt_v2.test.ts: Unit tests verifying streaming transcription with the Flux model.StartOfTurn,Update,EagerEndOfTurn,EndOfTurn).PREFLIGHT_TRANSCRIPTevents triggered byeagerEotThresholdto enable low-latency, preemptive LLM generation.Pre-Review Checklist
Testing
restaurant_agent.tsandrealtime_agent.tswork properly (for major changes)Test Verification
Ran
pnpm test plugins/deepgramwith a valid API key.stt_v2.test.tspassed (verified streaming transcription withflux-general-en).stt.test.tspassed (verified no regression in existing V1 implementation).Additional Notes
The
start_time_offsetis currently hardcoded to0.0as the baseSpeechStreamclass in agents does not yet expose this property. This matches the current capabilities of the TypeScript SDK while enabling the new model features.