langchain._api.deprecation.deprecated¶
langchain._api.deprecation.deprecated(since: str, *, message: str = '', name: str = '', alternative: str = '', pending: bool = False, obj_type: str = '', addendum: str = '', removal: str = '') → Callable[[T], T][source]¶
Decorator to mark a function, a class, or a property as deprecated.
When deprecating a classmethod, a staticmethod, or a property, the
@deprecated decorator should go under @classmethod and
@staticmethod (i.e., deprecated should directly decorate the
underlying callable), but over @property.
When deprecating a class C intended to be used as a base class in a
multiple inheritance hierarchy, C must define an __init__ method
(if C instead inherited its __init__ from its own base class, then
@deprecated would mess up __init__ inheritance when installing its
own (deprecation-emitting) C.__init__).
Parameters are the same as for warn_deprecated, except that obj_type
defaults to ‘class’ if decorating a class, ‘attribute’ if decorating a
property, and ‘function’ otherwise.
Parameters
since – str
The release at which this API became deprecated.
message – str, optional
Override the default deprecation message. The %(since)s,
%(name)s, %(alternative)s, %(obj_type)s, %(addendum)s,
and %(removal)s format specifiers will be replaced by the
values of the respective arguments passed to this function.
name – str, optional
The name of the deprecated object.
alternative – str, optional
An alternative API that the user may use in place of the
deprecated API. The deprecation warning will tell the user
about this alternative if provided.
pending – bool, optional