From 4c04e023c83fe581bbaef88a2990132132f95172 Mon Sep 17 00:00:00 2001 From: "open-swe[bot]" Date: Fri, 22 Aug 2025 13:11:14 +0000 Subject: [PATCH] Apply patch [skip ci] --- libs/prebuilt/langgraph/prebuilt/tool_node.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/libs/prebuilt/langgraph/prebuilt/tool_node.py b/libs/prebuilt/langgraph/prebuilt/tool_node.py index fe190aa96..6c2d35df7 100644 --- a/libs/prebuilt/langgraph/prebuilt/tool_node.py +++ b/libs/prebuilt/langgraph/prebuilt/tool_node.py @@ -992,6 +992,17 @@ class InjectedState(InjectedToolArg): class InjectedStore(InjectedToolArg): """Annotation for injecting persistent store into tool arguments. + .. deprecated:: 0.2.0 + Use reserved keyword 'runtime' instead of InjectedStore annotation. + The annotation-based approach will be removed in a future version. + + Instead of: + def tool(x: int, store: Annotated[BaseStore, InjectedStore()]) -> str: + + Use: + def tool(x: int, runtime) -> str: + # Access store via runtime.store + This annotation enables tools to access LangGraph's persistent storage system without exposing storage details to the language model. Tools annotated with InjectedStore receive the store instance automatically during execution while @@ -1329,3 +1340,4 @@ def _get_runtime_arg(tool: BaseTool) -> Optional[str]: +