From ee8ee418aed7ff31385ee212c2af3a5846590285 Mon Sep 17 00:00:00 2001 From: J3tCh3n <166098276+jet-isnt-haha@users.noreply.github.com> Date: Thu, 2 Oct 2025 23:05:04 +0800 Subject: [PATCH] docs: Update customer_support_small_model example to use non-deprecated methods --- examples/chatbots/customer_support_small_model.ipynb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/chatbots/customer_support_small_model.ipynb b/examples/chatbots/customer_support_small_model.ipynb index af492e193..e4cf44ed4 100644 --- a/examples/chatbots/customer_support_small_model.ipynb +++ b/examples/chatbots/customer_support_small_model.ipynb @@ -215,7 +215,7 @@ " let trimmedHistory = state.messages;\n", " // Make the user's question the most recent message in the history.\n", " // This helps small models stay focused.\n", - " if (trimmedHistory.at(-1)._getType() === \"ai\") {\n", + " if (trimmedHistory[trimmedHistory.length - 1].getType() === \"ai\") {\n", " trimmedHistory = trimmedHistory.slice(0, -1);\n", " }\n", "\n", @@ -275,7 +275,7 @@ " let trimmedHistory = state.messages;\n", " // Make the user's question the most recent message in the history.\n", " // This helps small models stay focused.\n", - " if (trimmedHistory.at(-1)._getType() === \"ai\") {\n", + " if (trimmedHistory[trimmedHistory.length - 1].getType() === \"ai\") {\n", " trimmedHistory = trimmedHistory.slice(0, -1);\n", " }\n", "\n", @@ -423,7 +423,7 @@ "source": [ "builder = builder\n", " .addEdge(\"technical_support\", \"__end__\")\n", - " .addConditionalEdges(\"billing_support\", async (state) => {\n", + " .addConditionalEdges(\"billing_support\", async (state: typeof StateAnnotation.State) => {\n", " if (state.nextRepresentative.includes(\"REFUND\")) {\n", " return \"refund\";\n", " } else {\n",