Skip to content

fix(cartesia): narrow aligned_transcript when timestamps unsupported (#6493) - #6735

Open
dorukdumlu wants to merge 1 commit into
livekit:mainfrom
dorukdumlu:fix/tts-aligned-transcript-capability
Open

fix(cartesia): narrow aligned_transcript when timestamps unsupported (#6493)#6735
dorukdumlu wants to merge 1 commit into
livekit:mainfrom
dorukdumlu:fix/tts-aligned-transcript-capability

Conversation

@dorukdumlu

Copy link
Copy Markdown

Summary

  • Narrow Cartesia capabilities.aligned_transcript to model/language combos that can actually deliver word timestamps (en/de/es/fr on sonic models; all languages on preview models), instead of mirroring the word_timestamps request flag.
  • Re-evaluate the capability on update_options when model/language changes, and skip add_timestamps in the WS payload when unsupported.
  • Warn with an explicit "model configuration does not support aligned transcript" message (Is capabilities.aligned_transcript meant to reflect requested vs. actually-delivered alignment? #6493).

Fixes #6493

Notes

  • ElevenLabs sync_alignment has no published model/language restriction matrix comparable to Cartesia's, so its capability stays tied to the request flag. Happy to extend if there's a known unsupported combo.
  • Delivery-time empty alignment streams (requested + supported but no TimedString arrives) are out of scope here — that needs a separate fallback path in generation.py / agent_activity.py.

Test plan

  • pytest tests/test_plugin_cartesia_tts.py --plugin cartesia (11 passed)
  • Confirm unsupported language (e.g. language="ja", sonic-3, word_timestamps=True) no longer triggers use_tts_aligned_transcript is enabled but no agent transcript was returned from tts when aligned transcripts are enabled on the session
  • Confirm supported language (en) still requests timestamps and keeps aligned_transcript=True

…ivekit#6493)

Cartesia warned on unsupported model/language combos but still advertised capabilities.aligned_transcript=True, which made use_tts_aligned_transcript expect timed text that never arrives. Clear the capability (and skip add_timestamps) when the config cannot deliver, and re-evaluate on update_options.

@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: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

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.

Is capabilities.aligned_transcript meant to reflect requested vs. actually-delivered alignment?

1 participant