From 6c8269909d09454a877eb62c977706cc5ed1c528 Mon Sep 17 00:00:00 2001 From: "open-swe[bot]" Date: Mon, 11 Aug 2025 20:19:16 +0000 Subject: [PATCH] Apply patch [skip ci] --- .../langgraph/prebuilt/chat_agent_executor.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/libs/prebuilt/langgraph/prebuilt/chat_agent_executor.py b/libs/prebuilt/langgraph/prebuilt/chat_agent_executor.py index 5ad1de688..9887694c8 100644 --- a/libs/prebuilt/langgraph/prebuilt/chat_agent_executor.py +++ b/libs/prebuilt/langgraph/prebuilt/chat_agent_executor.py @@ -570,7 +570,9 @@ def create_react_agent( if is_dynamic_model: resolved_model = model(state, runtime) # type: ignore[operator] if ( - _should_bind_tools(resolved_model, tool_classes, num_builtin=len(llm_builtin_tools)) # type: ignore[arg-type] + _should_bind_tools( + resolved_model, tool_classes, num_builtin=len(llm_builtin_tools) + ) # type: ignore[arg-type] and len(tool_classes + llm_builtin_tools) > 0 ): resolved_model = cast(BaseChatModel, resolved_model).bind_tools( @@ -587,7 +589,9 @@ def create_react_agent( if is_async_dynamic_model: resolved_model = await model(state, runtime) # type: ignore[misc,operator] if ( - _should_bind_tools(resolved_model, tool_classes, num_builtin=len(llm_builtin_tools)) # type: ignore[arg-type] + _should_bind_tools( + resolved_model, tool_classes, num_builtin=len(llm_builtin_tools) + ) # type: ignore[arg-type] and len(tool_classes + llm_builtin_tools) > 0 ): resolved_model = cast(BaseChatModel, resolved_model).bind_tools( @@ -597,7 +601,9 @@ def create_react_agent( elif is_dynamic_model: resolved_model = model(state, runtime) # type: ignore[operator] if ( - _should_bind_tools(resolved_model, tool_classes, num_builtin=len(llm_builtin_tools)) # type: ignore[arg-type] + _should_bind_tools( + resolved_model, tool_classes, num_builtin=len(llm_builtin_tools) + ) # type: ignore[arg-type] and len(tool_classes + llm_builtin_tools) > 0 ): resolved_model = cast(BaseChatModel, resolved_model).bind_tools( @@ -1038,10 +1044,3 @@ __all__ = [ "AgentStateWithStructuredResponse", "AgentStateWithStructuredResponsePydantic", ] - - - - - - -