From 48f02e0b5c09976baa295fbb7c76e9f7c795f182 Mon Sep 17 00:00:00 2001 From: HanishKVC Date: Thu, 30 May 2024 00:39:58 +0530 Subject: [PATCH] SimpleChat: readme stream-utf-8 trim-english deps, exception2error --- examples/server/public_simplechat/readme.md | 5 +++++ examples/server/public_simplechat/simplechat.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/server/public_simplechat/readme.md b/examples/server/public_simplechat/readme.md index 8acabeda5..83dec817d 100644 --- a/examples/server/public_simplechat/readme.md +++ b/examples/server/public_simplechat/readme.md @@ -133,6 +133,8 @@ It is attached to the document object. Some of these can also be updated using t bStream - control between oneshot-at-end and live-stream-as-its-generated collating and showing of the generated response. + the logic assumes that the text sent from the server follows utf-8 encoding. + apiEP - select between /completions and /chat/completions endpoint provided by the server/ai-model. bCompletionFreshChatAlways - whether Completion mode collates complete/sliding-window history when @@ -151,6 +153,9 @@ It is attached to the document object. Some of these can also be updated using t continue starting from the trimmed part, thus allows long response to be recovered/continued indirectly, in many cases. + The histogram/freq based trimming logic is currently tuned for english language wrt its + is-it-a-alpabetic|numeral-char regex match logic. + chatRequestOptions - maintains the list of options/fields to send along with chat request, irrespective of whether /chat/completions or /completions endpoint. diff --git a/examples/server/public_simplechat/simplechat.js b/examples/server/public_simplechat/simplechat.js index 02e4efe3e..f8d21826f 100644 --- a/examples/server/public_simplechat/simplechat.js +++ b/examples/server/public_simplechat/simplechat.js @@ -502,7 +502,7 @@ class MultiChatUI { } this.handle_user_submit(this.curChatId, gMe.apiEP).catch((/** @type{Error} */reason)=>{ let msg = `ERRR:SimpleChat\nMCUI:HandleUserSubmit:${this.curChatId}\n${reason.name}:${reason.message}`; - console.debug(msg.replace("\n", ":")); + console.error(msg.replace("\n", ":")); alert(msg); this.ui_reset_userinput(); });