From 4566b2aed44a0d3e89d7f4f51d485f09986fbcd5 Mon Sep 17 00:00:00 2001 From: "open-swe[bot]" Date: Fri, 22 Aug 2025 13:10:45 +0000 Subject: [PATCH] Apply patch [skip ci] --- libs/prebuilt/langgraph/prebuilt/tool_node.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libs/prebuilt/langgraph/prebuilt/tool_node.py b/libs/prebuilt/langgraph/prebuilt/tool_node.py index 6585b8abf..fe190aa96 100644 --- a/libs/prebuilt/langgraph/prebuilt/tool_node.py +++ b/libs/prebuilt/langgraph/prebuilt/tool_node.py @@ -908,6 +908,16 @@ def tools_condition( class InjectedState(InjectedToolArg): """Annotation for injecting graph state into tool arguments. + .. deprecated:: 0.2.0 + Use reserved keyword 'state' instead of InjectedState annotation. + The annotation-based approach will be removed in a future version. + + Instead of: + def tool(x: int, state: Annotated[dict, InjectedState]) -> str: + + Use: + def tool(x: int, state) -> str: + This annotation enables tools to access graph state without exposing state management details to the language model. Tools annotated with InjectedState receive state data automatically during execution while remaining invisible @@ -1318,3 +1328,4 @@ def _get_runtime_arg(tool: BaseTool) -> Optional[str]: +