fix(assemblyai): respect mode silence presets#1882
fix(assemblyai): respect mode silence presets#1882rosetta-livekit-bot[bot] wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
🚩 updateOptions does not re-derive minTurnSilence when mode changes post-construction
If a user constructs new STT() (no mode → constructor defaults minTurnSilence to 100) and later calls updateOptions({ mode: 'balanced' }), the baked-in minTurnSilence=100 persists because updateOptions (plugins/assemblyai/src/stt.ts:181-190) just spreads new opts over old ones without re-running the constructor's conditional defaulting logic. On the next WebSocket reconnect, min_turn_silence=100 will still be sent, potentially overriding the server's mode-based silence tuning. This is a pre-existing design limitation (updateOptions never re-derived dependent defaults), but the new mode-awareness makes the interaction slightly more surprising. Practically, mode is documented as connect-time only, so changing it via updateOptions is an unusual path.
(Refers to lines 181-190)
Was this helpful? React with 👍 or 👎 to provide feedback.
🦋 Changeset detectedLatest commit: 01f786b The changes in this PR will be included in the next version bump. This PR includes changesets to release 35 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Summary
modepreset is provided, unless the user explicitly sets silence valuesu3-protouniversal-3-5-pro@livekit/agents-plugin-assemblyaiTesting
pnpm --filter @livekit/agents-plugin-assemblyai buildpnpm test plugins/assemblyai/src/stt.test.tspnpm --filter @livekit/agents-plugin-assemblyai lintPorted from livekit/agents#6220
Original PR description
Summary
Three related fixes to the AssemblyAI streaming STT plugin:
1.
modepreset no longer overridden by the default turn-silenceWhen a streaming
mode(min_latency/balanced/max_accuracy) is set, the plugin previously still injected its latency-optimizedmin_turn_silence/max_turn_silence = 100into the connect config. Those explicit values override the mode preset's own silence tuning server-side, so selecting a mode had no effect on silence behavior.The 100ms default is now suppressed when a
modeis set, so the server's per-mode tuning applies. Values passed explicitly formin_turn_silence/max_turn_silencestill take precedence, and behavior is unchanged when no mode is set.modesentmin_turn_silencemax_turn_silencemodeset, min/max unsetmode(baseline)100100mode+ explicit min/max2. Deprecated
u3-proalias remapped touniversal-3-5-proThe deprecated
u3-proalias was rewritten tou3-rt-pro; it now maps touniversal-3-5-pro— the plugin's default and the recommended flagship streaming model. Both belong to the same Universal-3 Pro family and share every parameter, so the rewrite is a safe drop-in.3. Docs: collective "Universal-3 Pro family" terminology
Docstrings/comments now refer to the "Universal-3 Pro family" collectively instead of enumerating model names. This also aligns the
continuous_partials/interruption_delay/agent_contextdocs (which listed only two models) with the validation, which already accepts the whole family.Testing
modeomits silence defaults across all three presets, explicit min/max still sent, baseline (no mode) still injects 100ms, andu3-prodeprecation rewrite + warning.uv run pytest --plugin assemblyai→ 62 passed;ruffandmypyclean.