Skip to content

The agent engineering platform.

core[patch]: fix deprecation admonition in API ref (#28992)

ccurme7c28321f04f4
diff --git a/libs/core/langchain_core/_api/deprecation.py b/libs/core/langchain_core/_api/deprecation.py
index c7d1e87b3b..0e254053d8 100644
--- a/libs/core/langchain_core/_api/deprecation.py
+++ b/libs/core/langchain_core/_api/deprecation.py
@@ -360,10 +360,9 @@ def deprecated(
_addendum,
]
details = " ".join([component.strip() for component in components if component])
- package = (
- _package or _name.split(".")[0].replace("_", "-") if "." in _name else None
+ package = _package or (
+ _name.split(".")[0].replace("_", "-") if "." in _name else None
)
- since_str = f"{package}=={since}" if package else since
if removal:
if removal.startswith("1.") and package and package.startswith("langchain"):
removal_str = f"It will not be removed until {package}=={removal}."
@@ -372,7 +371,7 @@ def deprecated(
else:
removal_str = ""
new_doc = f"""\
-.. deprecated:: {since_str} {details} {removal_str}
+.. deprecated:: {since} {details} {removal_str}
{old_doc}\
"""