diff --git a/libs/core/langchain_core/_api/deprecation.py b/libs/core/langchain_core/_api/deprecation.py index 970cfa569463b..52c4e9c8dfa1b 100644 --- a/libs/core/langchain_core/_api/deprecation.py +++ b/libs/core/langchain_core/_api/deprecation.py @@ -257,10 +257,12 @@ def finalize( # type: ignore 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}" )