From 8c0b27a85bf58d503c6b79e9f6acc68263e09334 Mon Sep 17 00:00:00 2001 From: gbaian10 <34255899+gbaian10@users.noreply.github.com> Date: Tue, 3 Sep 2024 21:50:00 +0800 Subject: [PATCH] docs: fix Corrective RAG (CRAG) miss function (#1563) `Corrective RAG (CRAG) using local LLMs` miss `find_tool_calls_react` function --- examples/rag/langgraph_crag_local.ipynb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/examples/rag/langgraph_crag_local.ipynb b/examples/rag/langgraph_crag_local.ipynb index dbac6f697..d6e791ae3 100644 --- a/examples/rag/langgraph_crag_local.ipynb +++ b/examples/rag/langgraph_crag_local.ipynb @@ -429,6 +429,14 @@ "]\n", "\n", "\n", + "def find_tool_calls_react(messages):\n", + " \"\"\"\n", + " Find all tool calls in the messages returned\n", + " \"\"\"\n", + " tool_calls = [tc['name'] for m in messages['messages'] for tc in getattr(m, 'tool_calls', [])]\n", + " return tool_calls\n", + "\n", + "\n", "def check_trajectory_react(root_run: Run, example: Example) -> dict:\n", " \"\"\"\n", " Check if all expected tools are called in exact order and without any additional tool calls.\n",