diff --git a/docs/docs/how-tos/agent-handoffs.ipynb b/docs/docs/how-tos/agent-handoffs.ipynb index d17e12de9..579892208 100644 --- a/docs/docs/how-tos/agent-handoffs.ipynb +++ b/docs/docs/how-tos/agent-handoffs.ipynb @@ -516,9 +516,7 @@ "\n", " tool_response = tool_.invoke(tool_call)\n", " if isinstance(tool_response, ToolMessage):\n", - " results.append(\n", - " Command(goto=\"call_model\", update={\"messages\": [tool_response]})\n", - " )\n", + " results.append(Command(update={\"messages\": [tool_response]}))\n", "\n", " # handle tools that return Command directly\n", " elif isinstance(tool_response, Command):\n", @@ -531,6 +529,7 @@ " graph.add_node(call_model)\n", " graph.add_node(call_tools)\n", " graph.add_edge(START, \"call_model\")\n", + " graph.add_edge(\"call_tools\", \"call_model\")\n", "\n", " return graph.compile()" ]