feat(azure): add private_endpoint support to Azure TTS services#4549
Open
brunomartinez-lmi wants to merge 2 commits into
Open
feat(azure): add private_endpoint support to Azure TTS services#4549brunomartinez-lmi wants to merge 2 commits into
brunomartinez-lmi wants to merge 2 commits into
Conversation
…eHttpTTSService AzureSTTService already supports a private_endpoint parameter for connecting via Private Link or custom domain endpoints. This commit adds the same capability to both AzureTTSService (WebSocket streaming) and AzureHttpTTSService (HTTP), following the same pattern: when private_endpoint is provided, it is passed directly to SpeechConfig as the endpoint parameter instead of the region. This removes the need for users to subclass and monkey-patch the SpeechConfig after initialization. Closes pipecat-ai#2373 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
25e69c1 to
15b361d
Compare
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
Add
private_endpointparameter toAzureTTSServiceandAzureHttpTTSService, enabling connection via Private Link or custom domain endpoints.Motivation
AzureSTTServicealready supports aprivate_endpointparameter (added in PR #3967 and refined in PR #3974), but the TTS services still require a region-based endpoint. Users deploying Azure Speech resources with custom domains or Private Link must currently subclass and monkey-patch theSpeechConfigafter initialization.This PR brings TTS to parity with STT by passing
private_endpointdirectly to Azure SDK'sSpeechConfig(endpoint=...)constructor — the same pattern used in the STT service.Changes
private_endpointparameter toAzureBaseTTSService._init_azure_base()private_endpointparameter toAzureTTSService.__init__()private_endpointparameter toAzureHttpTTSService.__init__()start()methods to createSpeechConfigwithendpoint=whenprivate_endpointis provided (matching the STT implementation pattern)regionoptional (required only whenprivate_endpointis not provided)ValueErrorif neitherregionnorprivate_endpointis givenUsage
References
🤖 generated by copilot, pre-reviewed by me