diff --git a/libs/langgraph/langgraph/_api/deprecation.py b/libs/langgraph/langgraph/_api/deprecation.py index bd659d300..e70f5dd5e 100644 --- a/libs/langgraph/langgraph/_api/deprecation.py +++ b/libs/langgraph/langgraph/_api/deprecation.py @@ -11,14 +11,15 @@ F = TypeVar("F", bound=Callable[..., Any]) def deprecated( - version: str, alternative: str, *, example: str = "" + version: str, alternative: str, *, removal: str = "", example: str = "" ) -> Callable[[F], F]: def decorator(func: F) -> F: @functools.wraps(func) def wrapper(*args: Any, **kwargs: Any) -> Any: + removal_str = removal if removal else "a future version" message = ( f"{func.__name__} is deprecated as of version {version} and will be" - f" removed in a future version. Use {alternative} instead.{example}" + f" removed in {removal_str}. Use {alternative} instead.{example}" ) warnings.warn(message, LangGraphDeprecationWarning, stacklevel=2) return func(*args, **kwargs) diff --git a/libs/langgraph/langgraph/prebuilt/agent_executor.py b/libs/langgraph/langgraph/prebuilt/agent_executor.py index 9bdc170e3..c8b541a1b 100644 --- a/libs/langgraph/langgraph/prebuilt/agent_executor.py +++ b/libs/langgraph/langgraph/prebuilt/agent_executor.py @@ -44,6 +44,7 @@ def _get_agent_state(input_schema=None): @deprecated( "0.0.44", alternative="create_react_agent", + removal="0.2.0", example=""" from langgraph.prebuilt import create_react_agent diff --git a/libs/langgraph/langgraph/prebuilt/chat_agent_executor.py b/libs/langgraph/langgraph/prebuilt/chat_agent_executor.py index c2f398496..5099dd149 100644 --- a/libs/langgraph/langgraph/prebuilt/chat_agent_executor.py +++ b/libs/langgraph/langgraph/prebuilt/chat_agent_executor.py @@ -34,7 +34,7 @@ class AgentState(TypedDict): is_last_step: IsLastStep -@deprecated("0.0.44", "create_react_agent") +@deprecated("0.0.44", "create_react_agent", removal="0.2.0") def create_function_calling_executor( model: LanguageModelLike, tools: Union[ToolExecutor, Sequence[BaseTool]] ) -> CompiledGraph: