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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user