Repository navigation
Add interruption, backchanneling all in realtime - #255
Draft
raghavm243512 wants to merge 8 commits into
Draft
raghavm243512 wants to merge 8 commits into
raghavm243512 wants to merge 8 commits into
Conversation
This branch has not been deployed
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.
This PR has many changes and specific choices:
Overall design has 2 parts:
During assistant turn
User accepts STT streaming in text, on each text delta make a decision to interrupt. While the decision is being made, keep STT stream open to accept additional context, like a person generally can do
These decision can either be to keep listening, backchannel, or interrupt
After Assistant Turn (aka during User Turn)
Take committed transcript, generate audio and TTS like normal. Optionally, the LLM can decide it doesn't need to say anything yet. This specifically prevents speaking during pre_tool speech from the model (and the LLM can decide intelligently, using the content like "1 moment while I check" as a signal to not say anything)
Important qualities of decisions and their consequences
Both back channel and interrupt have specific cooldowns, and minimum talking amounts that must occur before they are able to be decided upon or made. Nobody says 'mhm' after someone says 'hello' to them, so some simple guards to induce realism and save compute are in place.
Things that changed (not new, but changed from base)
Using OpenAI STT as default as it is much faster, and with the open STT channel missed_words (new diagnostic metric) coming down to roughly 3-4 vs 6 for ElevenLabs
Metric/tracking
No metrics have received changes. For interruption, this is largely something that gets handled already with behavioral fidelity, the [interrupted] tags and stuff we had before handle this behavior. The audit log sees all interruptions but no back_channels
Nothing is consuming the saved back channel information yet. This is something to look at when a model breaks down as a turn taking problem
There are additional fields in result.json and a file for user_simulator_events.jsonl that is also not being consumed
Misc pieces
Some small updates to other scripts. All multilingual parts are included to keep the phrase caches up to date. Additional environment variables to control cooldown times, thresholds, are added.
If the gap between the opener and the content on an interruption is too long (set to 1 second but can adjust) then the run is failed. This should not trigger often, but I see an occasional long one which would break realism)
Pending things