fix(elevenlabs): end server vad turns#5872
Conversation
8d4efee to
6a54627
Compare
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
| async def _connect_ws(self) -> aiohttp.ClientWebSocketResponse: | ||
| """Establish WebSocket connection to ElevenLabs Scribe v2 API""" | ||
| commit_strategy = "manual" if self._opts.server_vad is None else "vad" | ||
| commit_strategy = "vad" if self._server_vad is not None else "manual" |
There was a problem hiding this comment.
π© Fix for pre-existing bug: NOT_GIVEN incorrectly treated as VAD-enabled
The old code at livekit-plugins/livekit-plugins-elevenlabs/livekit/plugins/elevenlabs/stt.py:488 had commit_strategy = "manual" if self._opts.server_vad is None else "vad". Since the default value of server_vad is NOT_GIVEN (not None), the is None check evaluated to False, causing commit_strategy to be "vad" for every user who didn't explicitly pass server_vad. The new _server_vad property correctly normalizes both NOT_GIVEN and None to None, fixing the default commit strategy to "manual". This is a behavioral change for all users relying on the default β they were previously getting server-side VAD without knowing it.
Was this helpful? React with π or π to provide feedback.
Summary
END_OF_SPEECHserver_vadoption as server VAD when building the realtime websocket URLTo verify
python -m py_compile livekit-plugins\livekit-plugins-elevenlabs\livekit\plugins\elevenlabs\stt.py tests\test_plugin_elevenlabs_stt.pyuv run ruff check livekit-plugins\livekit-plugins-elevenlabs\livekit\plugins\elevenlabs\stt.py tests\test_plugin_elevenlabs_stt.pyuv run pytest tests/test_plugin_elevenlabs_stt.py -q --basetemp .tmp\pytest-5849 -p no:cacheproviderRelated: #5849