@@ -1268,11 +1268,14 @@ async def amodel_node(state: AgentState, runtime: Runtime[ContextT]) -> dict[str
12681268
12691269 graph .add_conditional_edges (
12701270 "tools" ,
1271- _make_tools_to_model_edge (
1272- tool_node = tool_node ,
1273- model_destination = loop_entry_node ,
1274- structured_output_tools = structured_output_tools ,
1275- end_destination = exit_node ,
1271+ RunnableCallable (
1272+ _make_tools_to_model_edge (
1273+ tool_node = tool_node ,
1274+ model_destination = loop_entry_node ,
1275+ structured_output_tools = structured_output_tools ,
1276+ end_destination = exit_node ,
1277+ ),
1278+ trace = False ,
12761279 ),
12771280 tools_to_model_destinations ,
12781281 )
@@ -1289,19 +1292,25 @@ async def amodel_node(state: AgentState, runtime: Runtime[ContextT]) -> dict[str
12891292
12901293 graph .add_conditional_edges (
12911294 loop_exit_node ,
1292- _make_model_to_tools_edge (
1293- model_destination = loop_entry_node ,
1294- structured_output_tools = structured_output_tools ,
1295- end_destination = exit_node ,
1295+ RunnableCallable (
1296+ _make_model_to_tools_edge (
1297+ model_destination = loop_entry_node ,
1298+ structured_output_tools = structured_output_tools ,
1299+ end_destination = exit_node ,
1300+ ),
1301+ trace = False ,
12961302 ),
12971303 model_to_tools_destinations ,
12981304 )
12991305 elif len (structured_output_tools ) > 0 :
13001306 graph .add_conditional_edges (
13011307 loop_exit_node ,
1302- _make_model_to_model_edge (
1303- model_destination = loop_entry_node ,
1304- end_destination = exit_node ,
1308+ RunnableCallable (
1309+ _make_model_to_model_edge (
1310+ model_destination = loop_entry_node ,
1311+ end_destination = exit_node ,
1312+ ),
1313+ trace = False ,
13051314 ),
13061315 [loop_entry_node , exit_node ],
13071316 )
@@ -1602,7 +1611,7 @@ def jump_edge(state: dict[str, Any]) -> str:
16021611 if "model" in can_jump_to and name != model_destination :
16031612 destinations .append (model_destination )
16041613
1605- graph .add_conditional_edges (name , jump_edge , destinations )
1614+ graph .add_conditional_edges (name , RunnableCallable ( jump_edge , trace = False ) , destinations )
16061615
16071616 else :
16081617 graph .add_edge (name , default_destination )
0 commit comments