fix(cartesia): clear aligned_transcript when the combo cannot deliver timestamps - #6637
Open
biztex wants to merge 1 commit into
Open
fix(cartesia): clear aligned_transcript when the combo cannot deliver timestamps#6637biztex wants to merge 1 commit into
biztex wants to merge 1 commit into
Conversation
… timestamps word_timestamps=True (the default) set capabilities.aligned_transcript=True unconditionally at construction. For model/language combinations Cartesia documents as unable to return timing data, the plugin warned about the combination but left the capability set - so every turn downstream selected the TTS-aligned transcript path and warned that no agent transcript was returned from tts. Validate at construction instead: when the combination cannot deliver word timestamps, disable word_timestamps with a single clear warning, which both clears the capability and stops requesting timestamps from the API. An explicit word_timestamps=False opt-out stays silent. Fixes livekit#6493
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.
Fixes #6493
Implements the fix direction confirmed by @chenghao-mou on the issue ("we should validate the user input and disable it with a warning"). Credit to @onurburak9 for the precise analysis — happy to hand this back if you were mid-way on your own PR.
Problem
cartesia.TTS(word_timestamps=True)— the default — setcapabilities.aligned_transcript=Trueunconditionally at construction. For model/language combinations Cartesia documents as unable to return timing data, the plugin warned about the combination but left the capability set, souse_tts_aligned_transcriptselected the TTS-aligned path every turn and produced the recurring warning:use_tts_aligned_transcript is enabled but no agent transcript was returned from tts.Change
Validation moves to construction: when the model/language combination cannot deliver word timestamps (per Cartesia's endpoint-comparison docs — non-
previewmodels only support en/de/es/fr),word_timestampsis disabled with one clear warning. That both clearscapabilities.aligned_transcript(downstream falls back to forwarded text, no per-turn warnings) and stops requesting timestamps the API won't return. An explicitword_timestamps=Falseopt-out stays silent. The support predicate is a small named helper with the docs link.Scoped deliberately: elevenlabs'
sync_alignmentnarrowing needs provider knowledge about which of its model/language combos deliver alignment (no documented in-plugin check exists to promote), and thetimed_texts_futtruthiness question ingeneration.pyfrom the issue is a separate design discussion.Tests
New hermetic
tests/test_cartesia_tts_capabilities.py(9 cases): the support predicate across sonic/preview models, locale normalization (en-US→en), and capability narrowing at construction — set for supported combos, cleared (with the warning, and with_opts.word_timestamps=False) for unsupported ones, silent on explicit opt-out.