Skip to content

feat(deepgram): expose numerals option on STTv2 (Flux) - #6506

Closed
readbrent wants to merge 1 commit into
livekit:mainfrom
readbrent:bread/deepgram-sttv2-numerals
Closed

feat(deepgram): expose numerals option on STTv2 (Flux)#6506
readbrent wants to merge 1 commit into
livekit:mainfrom
readbrent:bread/deepgram-sttv2-numerals

Conversation

@readbrent

@readbrent readbrent commented Jul 22, 2026

Copy link
Copy Markdown

Summary

  • Exposes Deepgram's numerals field to STTv2 field

Context

Deepgram exposes a numerals field that converts numbers from their written format ("One") to their numerical format. This flag is exposed in the STTv1 model for their Nova models, but is not exposed on the STTv2 provider.

Testing

Closes #6505

@readbrent
readbrent requested a review from a team as a code owner July 22, 2026 00:33
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@readbrent readbrent closed this Jul 22, 2026

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

Open in Devin Review

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changing digit formatting on an active stream has no effect until an unrelated restart

The requested digit-formatting change is saved (self._opts.numerals = numerals at livekit-plugins/livekit-plugins-deepgram/livekit/plugins/deepgram/stt_v2.py:368-369) but is never sent to the service and does not trigger a fresh connection, so the change is silently ignored on the live stream.
Impact: A user who turns numeral conversion on or off mid-session sees no change until the connection happens to restart for another reason.

Why the update is dropped in SpeechStreamv2.update_options

In SpeechStreamv2.update_options, numerals is only ever passed to the service through the connection URL built in _connect_ws (stt_v2.py:579-580); it is not one of the in-band Configure fields. However, numerals is missing from the needs_reconnect tuple (model, sample_rate, mip_opt_out, tags, endpoint_url) at stt_v2.py:376-377, and it is also not added to changed_options (stt_v2.py:394-401, unlike language_hint/keyterm). As a result, when only numerals changes, needs_reconnect is False, no Configure message is queued, and self._reconnect_event is never set, so the new value only reaches the server on a later reconnect caused by a different option. mip_opt_out, another connection-URL-only param, is correctly listed in needs_reconnect.

(Refers to lines 376-377)

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(deepgram): expose numerals on STTv2 (Flux)

2 participants