feat(assemblyai): add u3-rt-pro model plus mid-stream updates, SpeechStarted, and ForceEndpoint support#4965
Open
gsharp-aai wants to merge 9 commits intolivekit:mainfrom
Open
Conversation
…eEndpoint - Rename model from u3-pro to u3-rt-pro - Replace reconnect-based update_options with UpdateConfiguration websocket messages - Add SpeechStarted event handler (maps to START_OF_SPEECH) - Add force_endpoint() to immediately finalize turns - Add keyterms_prompt to update_options/UpdateConfiguration - Fix interim_results capability (True, not False)
Move queue drain into a separate send_config_task coroutine so ForceEndpoint and UpdateConfiguration messages are sent immediately, even when no audio frames are flowing.
… u3-rt-pro Separate send_config_task from gather so it is cancelled in finally instead of blocking shutdown. Default language_detection to True for u3-rt-pro model.
Accept 'u3-pro' as a deprecated model name that remaps to 'u3-rt-pro' with a warning. For u3-rt-pro, default min_end_of_turn_silence_when_confident and max_turn_silence to 100ms (max follows min if only min is set) to minimize latency for external turn detectors.
Adds support for the new streaming diarization params (speaker_labels bool, max_speakers 1-10) as connection-level query params on the WebSocket URL.
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
Adds Universal-3-Pro (
u3-rt-pro) model support to the AssemblyAI streaming plugin with several improvements to the existing streaming implementation.New model
u3-rt-proto the supportedmodelliteralsu3-proname with a warning, remapped tou3-rt-propromptparameter (u3-rt-pro only) for custom transcription instructions, validated at initlanguage_detectiontoTrueforu3-rt-promodel (previously only defaulted formultilingualmodels)min_end_of_turn_silence_when_confidentandmax_turn_silenceto 100ms foru3-rt-profor optimal out-of-the-box performance/latency across most LiveKit configurations. This provides finals quickly for third-party turn detection models while still working well with built-in turn detection.min=100msandmax=1000ms.We will clearly document the plugin's defaults and how to override them.Speaker diarization support
speaker_labelsparameter (bool) to enable speaker diarization on the streaming connectionmax_speakersparameter (int, 1-10) to set the maximum number of speakers when diarization is enabledUpdateConfiguration)Mid-stream configuration updates
prompt,keyterms_prompt,max_turn_silence,min_end_of_turn_silence_when_confident,end_of_turn_confidence_threshold,vad_thresholdkeyterms_prompttoupdate_options()(previously only available at connection time)New websocket message support
SpeechStarted: Handle new server event, mapped toSpeechEventType.START_OF_SPEECHfor barge-in detectionForceEndpoint: Addforce_endpoint()method to immediately finalize the current turn via{"type": "ForceEndpoint"}Fixes
interim_results=TrueinSTTCapabilities(was incorrectlyFalsedespite emittingINTERIM_TRANSCRIPTevents)send_config_taskshutdown hang by separating it fromasyncio.gatherso it is cancelled infinallyinstead of blocking graceful shutdown