core,openai,grow,fw[patch]: deprecate bind_functions, update chat mod… (#26584)

…el api ref
This commit is contained in:
Bagatur
2024-09-17 11:32:39 -07:00
committed by GitHub
parent 7c05f71e0f
commit e1d113ea84
5 changed files with 55 additions and 22 deletions

View File

@@ -333,9 +333,26 @@ def deprecated(
old_doc = ""
# Modify the docstring to include a deprecation notice.
if (
_alternative
and _alternative.split(".")[-1].lower() == _alternative.split(".")[-1]
):
_alternative = f":meth:`~{_alternative}`"
elif _alternative:
_alternative = f":class:`~{_alternative}`"
if (
_alternative_import
and _alternative_import.split(".")[-1].lower()
== _alternative_import.split(".")[-1]
):
_alternative_import = f":meth:`~{_alternative_import}`"
elif _alternative_import:
_alternative_import = f":class:`~{_alternative_import}`"
components = [
_message,
f"Use ``{_alternative}`` instead." if _alternative else "",
f"Use {_alternative} instead." if _alternative else "",
f"Use ``{_alternative_import}`` instead." if _alternative_import else "",
_addendum,
]