diff --git a/libs/prebuilt/langgraph/prebuilt/chat_agent_executor.py b/libs/prebuilt/langgraph/prebuilt/chat_agent_executor.py index 3fa819615..12f40e3ff 100644 --- a/libs/prebuilt/langgraph/prebuilt/chat_agent_executor.py +++ b/libs/prebuilt/langgraph/prebuilt/chat_agent_executor.py @@ -587,15 +587,13 @@ 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( tool_classes + llm_builtin_tools # type: ignore[operator] ) - return _get_prompt_runnable(prompt) | resolved_model + return _get_prompt_runnable(prompt) | resolved_model # type: ignore[operator] elif is_dynamic_model: resolved_model = model(state, runtime) # type: ignore[operator] if ( @@ -1044,3 +1042,4 @@ __all__ = [ +