fix(elevenlabs): restore chunk_length_schedule in WS init payload#5006
Open
IanSteno wants to merge 2 commits intolivekit:mainfrom
Open
fix(elevenlabs): restore chunk_length_schedule in WS init payload#5006IanSteno wants to merge 2 commits intolivekit:mainfrom
IanSteno wants to merge 2 commits intolivekit:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
generation_config.chunk_length_schedulein ElevenLabs multi-context websocket init packetsauto_mode=Truefor normal usage, but default toauto_mode=Falsewhenchunk_length_scheduleis explicitly provided so the schedule is not implicitly disabledWhy
chunk_length_schedulehas been accepted/stored by the plugin but not forwarded in current multi-context websocket flow, making it a no-op in practice.Changes
livekit/plugins/elevenlabs/tts.py_build_context_init_packet(...)to include:textvoice_settingscontext_idgeneration_config.chunk_length_schedulewhen providedpronunciation_dictionary_locatorswhen provided_Connection._send_loop()init pathauto_mode = not is_given(chunk_length_schedule)whenauto_modeis not explicitly providedTests
Added
tests/test_plugin_elevenlabs_tts.pycovering:auto_modeoverride precedencegeneration_configwhen schedule is setgeneration_configwhen schedule is unsetRun locally:
uv run pytest tests/test_plugin_elevenlabs_tts.py -quv run ruff check livekit-plugins/livekit-plugins-elevenlabs/livekit/plugins/elevenlabs/tts.py tests/test_plugin_elevenlabs_tts.py