|
1 | 1 | import uuid |
| 2 | +import warnings |
2 | 3 | from typing import Any, Callable, Dict, List, Optional, Tuple |
3 | 4 |
|
4 | 5 | import chevron |
@@ -169,6 +170,7 @@ def config( |
169 | 170 | :param variables: Additional variables for the model configuration. |
170 | 171 | :return: The value of the model configuration along with a tracker used for gathering metrics. |
171 | 172 | """ |
| 173 | + warnings.warn("config() is deprecated, use completion_config() instead", DeprecationWarning, stacklevel=2) |
172 | 174 | return self.completion_config(key, context, default, variables) |
173 | 175 |
|
174 | 176 | def _judge_config( |
@@ -417,12 +419,9 @@ async def create_chat( |
417 | 419 | default_ai_provider: Optional[str] = None, |
418 | 420 | ) -> Optional[ManagedModel]: |
419 | 421 | """ |
420 | | - .. deprecated:: Use :meth:`create_model` instead. |
421 | | -
|
422 | | - Creates and returns a ManagedModel for AI conversations. |
423 | | - This method is a deprecated alias for :meth:`create_model`. |
| 422 | + .. deprecated:: Use :meth:`create_model` instead. This method will be removed in a future version. |
424 | 423 | """ |
425 | | - log.warning('create_chat() is deprecated, use create_model() instead') |
| 424 | + warnings.warn("create_chat() is deprecated, use create_model() instead", DeprecationWarning, stacklevel=2) |
426 | 425 | return await self.create_model(key, context, default, variables, default_ai_provider) |
427 | 426 |
|
428 | 427 | async def create_agent( |
@@ -545,6 +544,7 @@ def agent( |
545 | 544 | :param context: The context to evaluate the agent configuration in. |
546 | 545 | :return: Configured AIAgentConfig instance. |
547 | 546 | """ |
| 547 | + warnings.warn("agent() is deprecated, use agent_config() instead", DeprecationWarning, stacklevel=2) |
548 | 548 | return self.agent_config(config.key, context, config.default, config.variables) |
549 | 549 |
|
550 | 550 | def agent_configs( |
@@ -791,6 +791,7 @@ def agents( |
791 | 791 | :param context: The context to evaluate the agent configurations in. |
792 | 792 | :return: Dictionary mapping agent keys to their AIAgentConfig configurations. |
793 | 793 | """ |
| 794 | + warnings.warn("agents() is deprecated, use agent_configs() instead", DeprecationWarning, stacklevel=2) |
794 | 795 | return self.agent_configs(agent_configs, context) |
795 | 796 |
|
796 | 797 | def __evaluate( |
|
0 commit comments