Skip to content

Commit 2a07174

Browse files
formatting
1 parent 10664c5 commit 2a07174

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

src/uipath_langchain/agent/react/llm_node.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff 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

src/uipath_langchain/agent/react/router_utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""Routing functions for conditional edges in the agent graph."""
22

3-
43
from langchain_core.messages import AIMessage, AnyMessage
54

65
from ..exceptions import AgentNodeRoutingException

0 commit comments

Comments
 (0)