Make deprecated-init-param warnings recommend the preferred Service.Settings(...) pattern

Move the warning helper into AIService as _warn_init_param_moved_to_settings.
It now uses type(self).__name__ to produce messages like
"Use settings=AnthropicLLMService.Settings(model=...)" instead of the raw
settings class name "AnthropicLLMSettings(model=...)". Callers no longer need
to pass the settings class explicitly.
This commit is contained in:
Paul Kompfner
2026-03-11 13:04:15 -04:00
parent eb9212f152
commit e5b60ba095
81 changed files with 282 additions and 311 deletions

View File

@@ -28,7 +28,7 @@ from pipecat.frames.frames import (
VADUserStoppedSpeakingFrame,
)
from pipecat.processors.frame_processor import FrameDirection
from pipecat.services.settings import NOT_GIVEN, STTSettings, _NotGiven, _warn_deprecated_param
from pipecat.services.settings import NOT_GIVEN, STTSettings, _NotGiven
from pipecat.services.stt_latency import GRADIUM_TTFS_P99
from pipecat.services.stt_service import WebsocketSTTService
from pipecat.transcriptions.language import Language, resolve_language
@@ -162,7 +162,7 @@ class GradiumSTTService(WebsocketSTTService):
# 3. Apply params overrides — only if settings not provided
if params is not None:
_warn_deprecated_param("params", self.Settings)
self._warn_init_param_moved_to_settings("params")
if not settings:
default_settings.language = params.language
if params.delay_in_frames is not None: