Merge pull request #1641 from pipecat-ai/mb/11labs-input-params
ElevenLabs: InputParams can be set individually
This commit is contained in:
@@ -20,6 +20,10 @@ https://en.wikipedia.org/wiki/Saint_George%27s_Day_in_Catalonia
|
|||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
|
- The `InputParams` for `ElevenLabsTTSService` and `ElevenLabsHttpTTSService`
|
||||||
|
no longer require that `stability` and `similarity_boost` be set. You can
|
||||||
|
individually set each param.
|
||||||
|
|
||||||
- In `TwilioFrameSerializer`, `call_sid` is Optional so as to avoid a breaking
|
- In `TwilioFrameSerializer`, `call_sid` is Optional so as to avoid a breaking
|
||||||
changed. `call_sid` is required to automatically hang up.
|
changed. `call_sid` is required to automatically hang up.
|
||||||
|
|
||||||
|
|||||||
@@ -126,31 +126,14 @@ def build_elevenlabs_voice_settings(
|
|||||||
settings: Dictionary containing voice settings parameters
|
settings: Dictionary containing voice settings parameters
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Dictionary of voice settings or None if required parameters are missing
|
Dictionary of voice settings or None if no valid settings are provided
|
||||||
"""
|
"""
|
||||||
|
voice_setting_keys = ["stability", "similarity_boost", "style", "use_speaker_boost", "speed"]
|
||||||
|
|
||||||
voice_settings = {}
|
voice_settings = {}
|
||||||
if settings["stability"] is not None and settings["similarity_boost"] is not None:
|
for key in voice_setting_keys:
|
||||||
voice_settings["stability"] = settings["stability"]
|
if key in settings and settings[key] is not None:
|
||||||
voice_settings["similarity_boost"] = settings["similarity_boost"]
|
voice_settings[key] = settings[key]
|
||||||
if settings["style"] is not None:
|
|
||||||
voice_settings["style"] = settings["style"]
|
|
||||||
if settings["use_speaker_boost"] is not None:
|
|
||||||
voice_settings["use_speaker_boost"] = settings["use_speaker_boost"]
|
|
||||||
if settings["speed"] is not None:
|
|
||||||
voice_settings["speed"] = settings["speed"]
|
|
||||||
else:
|
|
||||||
if settings["style"] is not None:
|
|
||||||
logger.warning(
|
|
||||||
"'style' is set but will not be applied because 'stability' and 'similarity_boost' are not both set."
|
|
||||||
)
|
|
||||||
if settings["use_speaker_boost"] is not None:
|
|
||||||
logger.warning(
|
|
||||||
"'use_speaker_boost' is set but will not be applied because 'stability' and 'similarity_boost' are not both set."
|
|
||||||
)
|
|
||||||
if settings["speed"] is not None:
|
|
||||||
logger.warning(
|
|
||||||
"'speed' is set but will not be applied because 'stability' and 'similarity_boost' are not both set."
|
|
||||||
)
|
|
||||||
|
|
||||||
return voice_settings or None
|
return voice_settings or None
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user