File tree Expand file tree Collapse file tree
src/uipath_langchain/agent/react Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ def create_llm_node(
3737 model : BaseChatModel ,
3838 tools : Sequence [BaseTool ] | None = None ,
3939 thinking_messages_limit : int = MAX_CONSECUTIVE_THINKING_MESSAGES ,
40- is_conversational : bool = False
40+ is_conversational : bool = False ,
4141):
4242 """Create LLM node with dynamic tool_choice enforcement.
4343
@@ -59,7 +59,11 @@ async def llm_node(state: AgentGraphState):
5959
6060 consecutive_thinking_messages = count_consecutive_thinking_messages (messages )
6161
62- if not is_conversational and bindable_tools and consecutive_thinking_messages >= thinking_messages_limit :
62+ if (
63+ not is_conversational
64+ and bindable_tools
65+ and consecutive_thinking_messages >= thinking_messages_limit
66+ ):
6367 llm = base_llm .bind (tool_choice = tool_choice_required_value )
6468 else :
6569 llm = base_llm
Original file line number Diff line number Diff line change 11"""Routing functions for conditional edges in the agent graph."""
22
3-
43from langchain_core .messages import AIMessage , AnyMessage
54
65from ..exceptions import AgentNodeRoutingException
You can’t perform that action at this time.
0 commit comments