docs: update custom agent in handoffs doc (#2846)

This commit is contained in:
Vadym Barda
2024-12-20 14:59:38 +00:00
committed by GitHub
parent f520a38d30
commit c72107177b
+2 -3
View File
@@ -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()"
]