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

@@ -14,7 +14,6 @@ from loguru import logger
from pipecat.adapters.services.open_ai_adapter import OpenAILLMInvocationParams
from pipecat.services.openai.base_llm import BaseOpenAILLMService
from pipecat.services.openai.llm import OpenAILLMService
from pipecat.services.settings import _warn_deprecated_param
@dataclass
@@ -62,7 +61,7 @@ class CerebrasLLMService(OpenAILLMService):
# 2. Apply direct init arg overrides (deprecated)
if model is not None:
_warn_deprecated_param("model", self.Settings, "model")
self._warn_init_param_moved_to_settings("model", "model")
default_settings.model = model
# 3. (No step 3, as there's no params object to apply)