From 1d7739b7f53d9caefd187634b29dc35195739ba7 Mon Sep 17 00:00:00 2001 From: HanishKVC Date: Thu, 30 May 2024 10:47:18 +0530 Subject: [PATCH] SimpleChat: Allow for multiline system prompt Convert SystemPrompt into a textarea with 2 rows. Reduce user-input-textarea to 2 rows from 3, so that overall vertical space usage remains same. Shorten usage messages a bit, cleanup to sync with settings ui. --- examples/server/public_simplechat/index.html | 4 ++-- examples/server/public_simplechat/simplechat.js | 13 ++++++------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/examples/server/public_simplechat/index.html b/examples/server/public_simplechat/index.html index 137c16e82..f6413016f 100644 --- a/examples/server/public_simplechat/index.html +++ b/examples/server/public_simplechat/index.html @@ -32,7 +32,7 @@
- +

@@ -42,7 +42,7 @@
- +
diff --git a/examples/server/public_simplechat/simplechat.js b/examples/server/public_simplechat/simplechat.js index b0a74fe96..d115fb9b7 100644 --- a/examples/server/public_simplechat/simplechat.js +++ b/examples/server/public_simplechat/simplechat.js @@ -39,18 +39,15 @@ class ApiEP { let gUsageMsg = `

Usage

`; @@ -542,6 +539,8 @@ class MultiChatUI { // allow user to insert enter into the system prompt using shift+enter. // while just pressing enter key will lead to setting the system prompt. if ((ev.key === "Enter") && (!ev.shiftKey)) { + let value = this.elInSystem.value; + this.elInSystem.value = value.substring(0,value.length-1); let chat = this.simpleChats[this.curChatId]; chat.add_system_anytime(this.elInSystem.value, this.curChatId); chat.show(this.elDivChat);