Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions examples/chatbots/customer_support_small_model.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down