From f642fb6545051a33222ad51ecdbd9184f77e9689 Mon Sep 17 00:00:00 2001 From: Vadym Barda Date: Wed, 11 Dec 2024 16:43:29 -0500 Subject: [PATCH] langgraph[fix]: pass config to tools (#2724) Fixes #2723 --- libs/langgraph/langgraph/prebuilt/tool_node.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/langgraph/langgraph/prebuilt/tool_node.py b/libs/langgraph/langgraph/prebuilt/tool_node.py index d3d0751e2..e2ac50b8e 100644 --- a/libs/langgraph/langgraph/prebuilt/tool_node.py +++ b/libs/langgraph/langgraph/prebuilt/tool_node.py @@ -297,7 +297,7 @@ def _run_one( try: input = {**call, **{"type": "tool_call"}} - response = self.tools_by_name[call["name"]].invoke(input) + response = self.tools_by_name[call["name"]].invoke(input, config) # GraphInterrupt is a special exception that will always be raised. # It can be triggered in the following scenarios: @@ -352,7 +352,7 @@ async def _arun_one( try: input = {**call, **{"type": "tool_call"}} - response = await self.tools_by_name[call["name"]].ainvoke(input) + response = await self.tools_by_name[call["name"]].ainvoke(input, config) # GraphInterrupt is a special exception that will always be raised. # It can be triggered in the following scenarios: