From e9a0dad6a9617cdea6f8fde6794f523bf8fbb6d9 Mon Sep 17 00:00:00 2001 From: Vishnu Pratap Singh Rathore Date: Wed, 16 Apr 2025 08:16:02 +0530 Subject: [PATCH 1/2] Adding name for summarize_conversation node. This update adds a name for "summarize_conversation" node in the graph's add_node method for better readability. --- module-2/chatbot-summarization.ipynb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/module-2/chatbot-summarization.ipynb b/module-2/chatbot-summarization.ipynb index a41cbfed1..53aed5717 100644 --- a/module-2/chatbot-summarization.ipynb +++ b/module-2/chatbot-summarization.ipynb @@ -221,7 +221,7 @@ " \n", " # If there are more than six messages, then we summarize the conversation\n", " if len(messages) > 6:\n", - " return \"summarize_conversation\"\n", + " return \"summarization\"\n", " \n", " # Otherwise we can just end\n", " return END" @@ -274,12 +274,12 @@ "# Define a new graph\n", "workflow = StateGraph(State)\n", "workflow.add_node(\"conversation\", call_model)\n", - "workflow.add_node(summarize_conversation)\n", + "workflow.add_node(\"summarization\",summarize_conversation)\n", "\n", "# Set the entrypoint as conversation\n", "workflow.add_edge(START, \"conversation\")\n", "workflow.add_conditional_edges(\"conversation\", should_continue)\n", - "workflow.add_edge(\"summarize_conversation\", END)\n", + "workflow.add_edge(\"summarization\", END)\n", "\n", "# Compile\n", "memory = MemorySaver()\n", From 9fa93390954bacd854b62e774d2a2e04fc889cbe Mon Sep 17 00:00:00 2001 From: Vishnu Pratap Singh Rathore Date: Wed, 16 Apr 2025 09:26:16 +0530 Subject: [PATCH 2/2] Update node' name for summarize_conversation. Adding a suitable name for the summarize_conversation node, for making it more intuitive to understand, and improve readability. --- module-2/chatbot-summarization.ipynb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/module-2/chatbot-summarization.ipynb b/module-2/chatbot-summarization.ipynb index 53aed5717..a5f17c318 100644 --- a/module-2/chatbot-summarization.ipynb +++ b/module-2/chatbot-summarization.ipynb @@ -221,7 +221,7 @@ " \n", " # If there are more than six messages, then we summarize the conversation\n", " if len(messages) > 6:\n", - " return \"summarization\"\n", + " return \"summarize\"\n", " \n", " # Otherwise we can just end\n", " return END" @@ -274,12 +274,12 @@ "# Define a new graph\n", "workflow = StateGraph(State)\n", "workflow.add_node(\"conversation\", call_model)\n", - "workflow.add_node(\"summarization\",summarize_conversation)\n", + "workflow.add_node(\"summarize\",summarize_conversation)\n", "\n", "# Set the entrypoint as conversation\n", "workflow.add_edge(START, \"conversation\")\n", "workflow.add_conditional_edges(\"conversation\", should_continue)\n", - "workflow.add_edge(\"summarization\", END)\n", + "workflow.add_edge(\"summarize\", END)\n", "\n", "# Compile\n", "memory = MemorySaver()\n", @@ -363,7 +363,7 @@ "```\n", " # If there are more than six messages, then we summarize the conversation\n", " if len(messages) > 6:\n", - " return \"summarize_conversation\"\n", + " return \"summarize\"\n", "```\n", "\n", "We can pick up the conversation because we have the thread."