From 8501759f60a737225d8a2cd2d670c6532266f764 Mon Sep 17 00:00:00 2001 From: hanishkvc Date: Mon, 3 Nov 2025 12:37:59 +0530 Subject: [PATCH] SimpleChatTC:Cleanup:UsageNote, Initial SettingsInfo shown Usage Note * Cleanup / fix some wording. * Pick chat history handshaked len from config Ensure the settings info is uptodate wrt available tool names by chaining a reshowing with tools manager initialisation. --- tools/server/public_simplechat/simplechat.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/tools/server/public_simplechat/simplechat.js b/tools/server/public_simplechat/simplechat.js index d578001e82..297f76366b 100644 --- a/tools/server/public_simplechat/simplechat.js +++ b/tools/server/public_simplechat/simplechat.js @@ -277,7 +277,8 @@ class ChatMessageEx { } -let gUsageMsg = ` +function usage_note() { + let sUsageNote = `
Usage Note
  • Use shift+enter for inserting enter/newline.
  • -
  • Enter your query/response to ai assistant in textarea provided below.
  • -
  • settings-tools-enable should be true to enable tool calling.
  • +
  • Enter your query/response to ai assistant in text area provided below.
  • +
  • settings-tools-enabled should be true to enable tool calling.
  • -
  • Default ContextWindow = [System, Last9 Query+Resp, Cur Query].
  • +
  • ContextWindow = [System, Last[${gMe.chatProps.iRecentUserMsgCnt-1}] User Query/Resp, Cur Query].
  • -
    -`; + `; + return sUsageNote; +} /** @typedef {ChatMessageEx[]} ChatMessages */ @@ -1001,7 +1003,7 @@ class MultiChatUI { /** @type{HTMLElement} */(this.elLastChatMessage).scrollIntoView(false); // Stupid ts-check js-doc intersection ??? } else { if (bClear) { - this.elDivChat.innerHTML = gUsageMsg; + this.elDivChat.innerHTML = usage_note(); gMe.setup_load(this.elDivChat, chat); gMe.show_info(this.elDivChat, bShowInfoAll); } @@ -1457,7 +1459,7 @@ function startme() { document["du"] = du; // @ts-ignore document["tools"] = tools; - tools.init().then((toolNames)=>gMe.tools.toolNames=toolNames) + tools.init().then((toolNames)=>gMe.tools.toolNames=toolNames).then(()=>gMe.multiChat.chat_show(gMe.multiChat.curChatId)) for (let cid of gMe.defaultChatIds) { gMe.multiChat.new_chat_session(cid); }