feat(ultravox): support server-side external TTS voices via externalVoice - #6850
Open
ssgutierrez42 wants to merge 5 commits into
Open
feat(ultravox): support server-side external TTS voices via externalVoice#6850ssgutierrez42 wants to merge 5 commits into
ssgutierrez42 wants to merge 5 commits into
Conversation
|
|
longcw
approved these changes
Aug 14, 2026
longcw
left a comment
Contributor
There was a problem hiding this comment.
looks good to me. something nit:
| voice : str | UltravoxVoice | ||
| The voice to use for TTS. | ||
| external_voice : dict[str, Any], optional | ||
| The Ultravox configuration for an external TTS provider. Mutually exclusive with ``voice``. |
Contributor
There was a problem hiding this comment.
should we log a warning when both voice and external_voice are given?
Contributor
There was a problem hiding this comment.
external_voice cannot work with output_medium="text" too?
| "selectedTools": parse_tools(list(self._tools.function_tools.values())), | ||
| } | ||
|
|
||
| if is_given(self._realtime_model._opts.external_voice): |
Contributor
There was a problem hiding this comment.
should we skip a given but empty external_voice or raise an error, or fallback to voice?
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
external_voiceparameter toRealtimeModelto pass an external TTS provider configuration (e.g. ElevenLabs, Cartesia, MiniMax) through Ultravox's/callsAPI via theexternalVoicefieldexternal_voiceis provided, theexternalVoicekey is sent in the/callspayload instead ofvoice, keeping the model in voice mode so native barge-in is preserveddict[str, Any]to accommodate all provider variants without coupling to Ultravox's evolving schemaWhy
Ultravox's
output_medium="text"path (text-out half-cascade) cannot support barge-in — the plugin's interruption signal (playback_clear_buffer) only fires in voice mode, and Ultravox exposes no input-side speech-onset event. Server-sideexternalVoicesolves this by having Ultravox call the TTS provider directly, keeping the session in voice mode with working interruption.Changes
_UltravoxOptions: addedexternal_voice: NotGivenOr[dict[str, Any]]RealtimeModel.__init__: addedexternal_voicekeyword argument (defaults toNOT_GIVEN), documented as mutually exclusive withvoice/callspayload construction:voiceis now conditional — whenexternal_voiceis given,externalVoiceis sent insteadReferences
/callsAPI: https://docs.ultravox.ai/api-reference/calls/calls-post