Skip to content

The agent engineering platform.

core[patch]: deprecation docstring with lib (#18350)

Erick Friis11cb42c2c163
diff --git a/libs/core/langchain_core/_api/deprecation.py b/libs/core/langchain_core/_api/deprecation.py
index 970cfa5694..52c4e9c8df 100644
--- a/libs/core/langchain_core/_api/deprecation.py
+++ b/libs/core/langchain_core/_api/deprecation.py
@@ -257,10 +257,12 @@ def deprecated(
addendum,
]
details = " ".join([component.strip() for component in components if component])
+ package = _name.split(".")[0].replace("_", "-") if "." in _name else None
+ since_str = f"{package}=={since}" if package else since
new_doc = (
f"[*Deprecated*] {old_doc}\n"
f"{notes_header if notes_header not in old_doc else ''}\n"
- f".. deprecated:: {since}\n"
+ f".. deprecated:: {since_str}\n"
f" {details}"
)