Feat/anam add director notes cue support#6278
Draft
sr-anam wants to merge 3 commits into
Draft
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.
Requires - #6267
What
Adds inline director-note cues to the Anam avatar plugin:
director_note_cue_transform, atts_text_transformscallable that readsbracket cues (e.g.
[happy],[sad]) in the agent's speech and forwards them tothe Anam engine, keyed by where each lands in the spoken text — so the avatar's
expression changes moment-to-moment, mid-utterance, driven by the LLM's own
output.
Why
The plugin can stream an Anam avatar but gives no way to drive its expression at
runtime. Letting the LLM emit
[tag]cues inline means expression follows thecontent of what's being said, with no separate control channel and no extra
turn-taking.
Design
tts_text_transformsentry — composes with other transforms andneeds no changes to the avatar session.
stripped_tags(remove the tagbefore TTS) and
forwarded_tags(send it to Anam). So: strip+forward for a TTSthat would otherwise speak the tag (ElevenLabs), forward-only for a tag both
face and voice should act on (
[laughter]), and a no-op for a TTS that handlesthe tags itself (Cartesia
sonic-3.5). Non-preset brackets (e.g. ElevenLabs[whispers]) pass through by default.director_note_cuetopic,targeted only at the engine participant (discovered via
lk.publish_on_behalf),consistent with how the framework's avatar audio output coordinates with its
worker.
use_tts_aligned_transcript=Trueis required.Scoped entirely to
livekit-plugins-anam; no change to default behavior forexisting users.