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

@@ -46,10 +46,15 @@ class CerebrasLLMService(OpenAILLMService):
parameters, ``settings`` values take precedence.
**kwargs: Additional keyword arguments passed to OpenAILLMService.
"""
if model is not None:
_warn_deprecated_param("model", "OpenAILLMSettings", "model")
# 1. Initialize default_settings with hardcoded defaults
default_settings = OpenAILLMSettings(model="gpt-oss-120b")
default_settings = OpenAILLMSettings(model=model or "gpt-oss-120b")
# 2. Apply direct init arg overrides (deprecated)
if model is not None:
_warn_deprecated_param("model", OpenAILLMSettings, "model")
default_settings.model = model
# 4. Apply settings delta (canonical API, always wins)
if settings is not None:
default_settings.apply_update(settings)