mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-07-04 10:52:17 +02:00
feat: configurable ElevenLabs base URL for Data Residency (#278)
* feat: configurable ElevenLabs base URL for Data Residency (#269) Adds a `base_url` field to `ElevenlabsTTSConfiguration` so users on an ElevenLabs Data Residency plan (EU, etc.) can point Dograh at the regional endpoint instead of the hardcoded global one. Defaults to `https://api.elevenlabs.io`, preserving existing behaviour. The service factory rewrites the HTTP scheme to WSS when constructing the WebSocket TTS service. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix: fix drift --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
f2cb6499e1
commit
7f0dac1ad5
3 changed files with 17 additions and 2 deletions
|
|
@ -247,9 +247,16 @@ def create_tts_service(user_config, audio_config: "AudioConfig"):
|
|||
voice_id = user_config.tts.voice.split(" - ")[1]
|
||||
except IndexError:
|
||||
voice_id = user_config.tts.voice
|
||||
# ElevenLabs TTS uses WebSocket. Users configure base_url with an HTTP
|
||||
# scheme (matching ElevenLabs documentation, e.g.
|
||||
# https://api.eu.residency.elevenlabs.io); rewrite it to the WS scheme.
|
||||
elevenlabs_url = user_config.tts.base_url.replace("https://", "wss://").replace(
|
||||
"http://", "ws://"
|
||||
)
|
||||
return ElevenLabsTTSService(
|
||||
reconnect_on_error=False,
|
||||
api_key=user_config.tts.api_key,
|
||||
url=elevenlabs_url,
|
||||
settings=ElevenLabsTTSSettings(
|
||||
voice=voice_id,
|
||||
model=user_config.tts.model,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue