From f0dd91d550ab5337538e326a1f837573397e030e Mon Sep 17 00:00:00 2001 From: HanishKVC Date: Thu, 23 May 2024 21:18:48 +0530 Subject: [PATCH] SimpleChat: Consolidate global vars into gMe, Display to user This allows the end user to see the settings used by the logic, as well as allows users to change/update the settings if they want to by using devel-tools/console --- examples/server/public_simplechat/readme.md | 19 +++-- .../server/public_simplechat/simplechat.js | 72 ++++++++++++++----- 2 files changed, 68 insertions(+), 23 deletions(-) diff --git a/examples/server/public_simplechat/readme.md b/examples/server/public_simplechat/readme.md index 72a428075..d8818b738 100644 --- a/examples/server/public_simplechat/readme.md +++ b/examples/server/public_simplechat/readme.md @@ -93,12 +93,21 @@ Once inside ## Devel note -gChatRequestOptions maintains the list of options/fields to send along with chat request, -irrespective of whether /chat/completions or /completions endpoint. +Me/gMe consolidates the settings which control the behaviour into one object. +One can see the current settings, as well as change/update them using browsers devel-tool/console. - If you want to add additional options/fields to send to the server/ai-model, and or - modify the existing options value, for now you can update this global var using - browser's development-tools/console. + bCompletionFreshChatAlways - whether Completion mode collates completion history when communicating + with the server. + + bCompletionInsertStandardRolePrefix - whether Completion mode inserts role related prefix wrt the + messages that get inserted into prompt field wrt /Completion endpoint. + + chatRequestOptions - maintains the list of options/fields to send along with chat request, + irrespective of whether /chat/completions or /completions endpoint. + + If you want to add additional options/fields to send to the server/ai-model, and or + modify the existing options value, for now you can update this global var using + browser's development-tools/console. Sometimes the browser may be stuborn with caching of the file, so your updates to html/css/js may not be visible. Also remember that just refreshing/reloading page in browser or for that diff --git a/examples/server/public_simplechat/simplechat.js b/examples/server/public_simplechat/simplechat.js index 303886b26..97a300eac 100644 --- a/examples/server/public_simplechat/simplechat.js +++ b/examples/server/public_simplechat/simplechat.js @@ -14,6 +14,7 @@ class ApiEP { } let gUsageMsg = ` +

Usage