From 53d66a8a04c5918fee3c7e8f959b0428bd00afea Mon Sep 17 00:00:00 2001 From: Kamal Shrestha <35168911+shresthakamal@users.noreply.github.com> Date: Mon, 4 Mar 2024 05:26:21 +0530 Subject: [PATCH] =?UTF-8?q?[bug]=20:=20Fix=20the=20score=20printing?= =?UTF-8?q?=E2=80=A6=20(#174)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * bug[examples/rag/langgraph_agentic_rag.ipynb]: Fix the score printing when grader scores "no" and changing "msg" in rewrite node to list * Update examples/rag/langgraph_agentic_rag.ipynb --------- Co-authored-by: Harrison Chase --- examples/rag/langgraph_agentic_rag.ipynb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/rag/langgraph_agentic_rag.ipynb b/examples/rag/langgraph_agentic_rag.ipynb index 07ca74be3..b45d6b469 100644 --- a/examples/rag/langgraph_agentic_rag.ipynb +++ b/examples/rag/langgraph_agentic_rag.ipynb @@ -267,7 +267,7 @@ "\n", " else:\n", " print(\"---DECISION: DOCS NOT RELEVANT---\")\n", - " print(score.binary_score)\n", + " print(grade)\n", " return \"no\"\n", "\n", "\n", @@ -338,7 +338,7 @@ " messages = state[\"messages\"]\n", " question = messages[0].content\n", "\n", - " msg = HumanMessage(\n", + " msg = [HumanMessage(\n", " content=f\"\"\" \\n \n", " Look at the input and try to reason about the underlying semantic intent / meaning. \\n \n", " Here is the initial question:\n", @@ -346,7 +346,7 @@ " {question} \n", " \\n ------- \\n\n", " Formulate an improved question: \"\"\",\n", - " )\n", + " )]\n", "\n", " # Grader\n", " model = ChatOpenAI(temperature=0, model=\"gpt-4-0125-preview\", streaming=True)\n",