From 8042cb950d594735e5f5788ca16d29ca2f64bc6d Mon Sep 17 00:00:00 2001 From: HanishKVC Date: Wed, 22 May 2024 18:56:51 +0530 Subject: [PATCH] SimpleChat: A placeholder system prompt, Use usage msg in code Just have a alert msg wrt needing javascript enabled in html. And have usage message from js file. Update the usage message a bit. So also enable switch session wrt setup_ui call. Add a possible system prompt as a placeholder for the system-input. --- examples/server/public_simplechat/index.html | 7 ++----- examples/server/public_simplechat/simplechat.js | 12 +++++++----- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/examples/server/public_simplechat/index.html b/examples/server/public_simplechat/index.html index 1eb390b85..72a91a09b 100644 --- a/examples/server/public_simplechat/index.html +++ b/examples/server/public_simplechat/index.html @@ -30,15 +30,12 @@
- +

-

Enter the system prompt above, before entering/submitting any user query.

-

Enter your text to the ai assistant below.

-

Use shift+enter for inserting enter.

-

Refresh the page to start over fresh.

+

You need to have javascript enabled.


diff --git a/examples/server/public_simplechat/simplechat.js b/examples/server/public_simplechat/simplechat.js index 3fc4dbc20..51986ad9c 100644 --- a/examples/server/public_simplechat/simplechat.js +++ b/examples/server/public_simplechat/simplechat.js @@ -14,10 +14,12 @@ class ApiEP { } let gUsageMsg = ` -

Enter the system prompt above, before entering/submitting any user query.

-

Enter your text to the ai assistant below.

-

Use shift+enter for inserting enter.

-

Refresh the page to start over fresh.

+ `; class SimpleChat { @@ -471,7 +473,7 @@ function startme() { for (let cid of gChatIds) { gMuitChat.new_chat_session(cid); } - gMuitChat.setup_ui(gChatIds[0]); + gMuitChat.setup_ui(gChatIds[0], true); gMuitChat.show_sessions(); }