mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-09-10 11:47:51 +02:00
noself
This commit is contained in:
@@ -191,9 +191,9 @@
|
||||
" node = node.parent\n",
|
||||
" # Reverse the final back-tracked trajectory to return in the correct order\n",
|
||||
" return messages[::-1] # root solution, reflection, child 1, ...\n",
|
||||
" \n",
|
||||
"\n",
|
||||
" def _get_all_children(self):\n",
|
||||
" all_nodes = [self]\n",
|
||||
" all_nodes = []\n",
|
||||
" nodes = deque()\n",
|
||||
" nodes.append(self)\n",
|
||||
" while nodes:\n",
|
||||
@@ -205,7 +205,7 @@
|
||||
"\n",
|
||||
" def get_best_solution(self):\n",
|
||||
" \"\"\"Return the best solution from within the current sub-tree.\"\"\"\n",
|
||||
" all_nodes = self._get_all_children()\n",
|
||||
" all_nodes = [self] + self._get_all_children()\n",
|
||||
" best_node = max(\n",
|
||||
" all_nodes,\n",
|
||||
" # We filter out all non-terminal, non-solution trajectories\n",
|
||||
|
||||
Reference in New Issue
Block a user