From 994285127334e3d8203521cfcc045960358a605a Mon Sep 17 00:00:00 2001 From: HanishKVC Date: Fri, 17 May 2024 22:12:40 +0530 Subject: [PATCH] SimpleChat: Diff user/assistant msgs, Make input wider Also show a default message to user Also add some metas --- examples/server/public/simplechat.html | 19 +++++++++++++++++-- examples/server/public/simplechat.js | 3 +++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/examples/server/public/simplechat.html b/examples/server/public/simplechat.html index 8426b384b..9f0ba9831 100644 --- a/examples/server/public/simplechat.html +++ b/examples/server/public/simplechat.html @@ -1,12 +1,27 @@ Simple LlamaCPP Chat + + + + -
+

SimpleChat

+
+
+

Enter your text to the ai assistant below

+

- \ No newline at end of file + diff --git a/examples/server/public/simplechat.js b/examples/server/public/simplechat.js index 5f27c09bf..9aa5bae38 100644 --- a/examples/server/public/simplechat.js +++ b/examples/server/public/simplechat.js @@ -1,4 +1,6 @@ // @ts-check +// A simple completions and chat/completions test related web front end logic +// by Humans for All class Roles { static System = "system"; @@ -39,6 +41,7 @@ class SimpleChat { } for(const x of this.xchat) { let entry = document.createElement("p"); + entry.className = `role-${x.role}`; entry.innerText = `${x.role}: ${x.content}`; div.appendChild(entry); }