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