Skip to content

fix(assemblyai): respect mode silence presets#1882

Open
rosetta-livekit-bot[bot] wants to merge 1 commit into
mainfrom
fix/assemblyai-mode-silence
Open

fix(assemblyai): respect mode silence presets#1882
rosetta-livekit-bot[bot] wants to merge 1 commit into
mainfrom
fix/assemblyai-mode-silence

Conversation

@rosetta-livekit-bot

@rosetta-livekit-bot rosetta-livekit-bot Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • leave AssemblyAI turn-silence defaults unset when a mode preset is provided, unless the user explicitly sets silence values
  • remap deprecated u3-pro to universal-3-5-pro
  • add a patch changeset for @livekit/agents-plugin-assemblyai

Testing

  • pnpm --filter @livekit/agents-plugin-assemblyai build
  • pnpm test plugins/assemblyai/src/stt.test.ts
  • pnpm --filter @livekit/agents-plugin-assemblyai lint

Ported from livekit/agents#6220

Original PR description

Summary

Three related fixes to the AssemblyAI streaming STT plugin:

1. mode preset no longer overridden by the default turn-silence

When a streaming mode (min_latency / balanced / max_accuracy) is set, the plugin previously still injected its latency-optimized min_turn_silence / max_turn_silence = 100 into 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 mode is set, so the server's per-mode tuning applies. Values passed explicitly for min_turn_silence / max_turn_silence still take precedence, and behavior is unchanged when no mode is set.

Case mode sent min_turn_silence max_turn_silence
mode set, min/max unset yes omitted omitted
no mode (baseline) 100 100
mode + explicit min/max yes explicit explicit

2. Deprecated u3-pro alias remapped to universal-3-5-pro

The deprecated u3-pro alias was rewritten to u3-rt-pro; it now maps to universal-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_context docs (which listed only two models) with the validation, which already accepts the whole family.

Testing

  • Added/updated unit tests: mode omits silence defaults across all three presets, explicit min/max still sent, baseline (no mode) still injects 100ms, and u3-pro deprecation rewrite + warning.
  • uv run pytest --plugin assemblyai62 passed; ruff and mypy clean.

@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.

🚩 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)

Open in Devin Review

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

@changeset-bot

changeset-bot Bot commented Jun 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 01f786b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 35 packages
Name Type
@livekit/agents-plugin-assemblyai Patch
@livekit/agents Patch
@livekit/agents-plugin-anam Patch
@livekit/agents-plugin-baseten Patch
@livekit/agents-plugin-bey Patch
@livekit/agents-plugin-cartesia Patch
@livekit/agents-plugin-cerebras Patch
@livekit/agents-plugin-deepgram Patch
@livekit/agents-plugin-did Patch
@livekit/agents-plugin-elevenlabs Patch
@livekit/agents-plugin-fishaudio Patch
@livekit/agents-plugin-google Patch
@livekit/agents-plugin-hedra Patch
@livekit/agents-plugin-hume Patch
@livekit/agents-plugin-inworld Patch
@livekit/agents-plugin-lemonslice Patch
@livekit/agents-plugin-liveavatar Patch
@livekit/agents-plugin-livekit Patch
@livekit/agents-plugin-minimax Patch
@livekit/agents-plugin-mistral Patch
@livekit/agents-plugin-mistralai Patch
@livekit/agents-plugin-neuphonic Patch
@livekit/agents-plugin-openai Patch
@livekit/agents-plugin-perplexity Patch
@livekit/agents-plugin-phonic Patch
@livekit/agents-plugin-resemble Patch
@livekit/agents-plugin-rime Patch
@livekit/agents-plugin-runway Patch
@livekit/agents-plugin-sarvam Patch
@livekit/agents-plugin-silero Patch
@livekit/agents-plugin-soniox Patch
@livekit/agents-plugin-tavus Patch
@livekit/agents-plugin-trugen Patch
@livekit/agents-plugin-xai Patch
@livekit/agents-plugins-test Patch

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

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.

0 participants