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",