Change _warn_deprecated_param to accept type references instead of strings

Update all ~192 call sites across 84 service files to pass class references
(e.g. `CartesiaTTSSettings`) instead of string names (`"CartesiaTTSSettings"`)
to `_warn_deprecated_param()`. This enables better IDE refactoring support.

Also fix `from_mapping` return type annotations in 5 settings subclasses to
use `typing.Self` instead of forward reference strings.
This commit is contained in:
Mark Backman
2026-03-03 19:52:09 -05:00
parent bc2843e30a
commit 07f1d0cd96
82 changed files with 2321 additions and 1321 deletions

View File

@@ -125,17 +125,25 @@ class LmntTTSService(InterruptibleTTSService):
parameters, ``settings`` values take precedence.
**kwargs: Additional arguments passed to parent InterruptibleTTSService.
"""
if voice_id is not None:
_warn_deprecated_param("voice_id", "LmntTTSSettings", "voice")
if model is not None:
_warn_deprecated_param("model", "LmntTTSSettings", "model")
# 1. Initialize default_settings with hardcoded defaults
default_settings = LmntTTSSettings(
model=model or "blizzard",
voice=voice_id,
model="blizzard",
voice=None,
language=self.language_to_service_language(language),
format="raw",
)
# 2. Apply direct init arg overrides (deprecated)
if voice_id is not None:
_warn_deprecated_param("voice_id", LmntTTSSettings, "voice")
default_settings.voice = voice_id
if model is not None:
_warn_deprecated_param("model", LmntTTSSettings, "model")
default_settings.model = model
# 3. No params for this service
# 4. Apply settings delta (canonical API, always wins)
if settings is not None:
default_settings.apply_update(settings)