feat(deepgram): expose numerals option on STTv2 (Flux) - #6506
Conversation
|
|
There was a problem hiding this comment.
🟡 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)
Was this helpful? React with 👍 or 👎 to provide feedback.
Summary
Context
Deepgram exposes a
numeralsfield 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