Skip to content

feat(elevenlabs): support keyterms, no_verbatim, enable_logging on STT realtime#5618

Open
BkSouX wants to merge 2 commits intolivekit:mainfrom
BkSouX:feat/elevenlabs-realtime-keyterms-no-verbatim
Open

feat(elevenlabs): support keyterms, no_verbatim, enable_logging on STT realtime#5618
BkSouX wants to merge 2 commits intolivekit:mainfrom
BkSouX:feat/elevenlabs-realtime-keyterms-no-verbatim

Conversation

@BkSouX
Copy link
Copy Markdown
Contributor

@BkSouX BkSouX commented May 1, 2026

Summary

The ElevenLabs Scribe v2 realtime STT API exposes three query parameters that the plugin does not currently forward to the WebSocket connection:

  • keyterms — biases recognition toward domain terms (already accepted in STT.__init__ but only used for batch recognition).
  • no_verbatim — strips filler words and disfluencies from the transcript.
  • enable_logging — set to false to enable zero-retention mode (useful for privacy/compliance-sensitive deployments).

This PR wires all three through STTOptions, STT.__init__, STT.update_options, and SpeechStream._connect_ws, and updates the keyterms docstring to reflect realtime support.

Changes

  • livekit-plugins/livekit-plugins-elevenlabs/livekit/plugins/elevenlabs/stt.py:
    • Add no_verbatim and enable_logging to STTOptions, STT.__init__, STT.update_options.
    • URL-encode keyterms values (one keyterms=<term> per item) and append no_verbatim / enable_logging to the realtime query string in _connect_ws.
    • Update keyterms docstring (was: "Only supported for Scribe v2 batch recognition (not realtime streaming)").
  • tests/test_plugin_elevenlabs_stt.py: 12 new unit tests covering defaults, constructor, update_options, and realtime query-string construction (no API key required).

Test plan

  • ruff check and ruff format --check pass
  • mypy passes on the modified plugin source
  • pytest tests/test_plugin_elevenlabs_stt.py — 12/12 passing
  • Manual smoke test against ElevenLabs realtime endpoint with the three params set

Notes

  • token and commit_strategy query params are not added: the former is only relevant for client-side single-use auth (the plugin uses xi-api-key), and the latter is already derived from server_vad.
  • No changelog entry is included per CONTRIBUTING.md.

devin-ai-integration[bot]

This comment was marked as resolved.

Each keyterm can contain at most 5 words and must be less than 50 characters.
Maximum of 100 keyterms. Only supported for Scribe v2 batch recognition
(not realtime streaming). Usage incurs additional costs.
Maximum of 100 keyterms. Supported for Scribe v2 batch recognition and for the
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

An informational correction on the comment:

The keyterms docstring says "Maximum of 100 keyterms, each less than 50 characters" for both batch and realtime, but the ElevenLabs API reference for the realtime endpoint documents maximum 50 keyterms, each up to 20 characters.

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.

2 participants