From 3458d2f8c3baedfc241d425a9e0d2d8fc0290bb3 Mon Sep 17 00:00:00 2001 From: HanishKVC Date: Tue, 21 May 2024 17:39:49 +0530 Subject: [PATCH] SimpleChat:GetSystemLatest, fix a oversight. --- examples/server/public_simplechat/simplechat.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/server/public_simplechat/simplechat.js b/examples/server/public_simplechat/simplechat.js index ce7d77275..2e3da03ca 100644 --- a/examples/server/public_simplechat/simplechat.js +++ b/examples/server/public_simplechat/simplechat.js @@ -144,11 +144,11 @@ class SimpleChat { /** * Retrieve the latest system prompt. */ - get_system() { - let sysPrompt = this.xchat[this.iLastSys].content; - if (!sysPrompt) { - sysPrompt = ""; + get_system_latest() { + if (this.iLastSys == -1) { + return ""; } + let sysPrompt = this.xchat[this.iLastSys].content; return sysPrompt; } @@ -353,7 +353,7 @@ class MultiChatUI { console.error(`ERRR:MCUI:Session:${chatId} missing...`); return; } - this.elInSystem.value = chat.get_system(); + this.elInSystem.value = chat.get_system_latest(); this.elInUser.value = ""; chat.show(this.elDivChat); this.elInUser.focus();