SimpleChatTC:Cleanup:ChatProps: bCompletionFreshChatAlways

Moved into Me.chatProps
This commit is contained in:
hanishkvc 2025-10-22 00:07:22 +05:30
parent 78ccca056f
commit 734f74c908
2 changed files with 7 additions and 7 deletions

View File

@ -202,6 +202,9 @@ It is attached to the document object. Some of these can also be updated using t
0 : Send only the system message if any to the server
>0 : Send the latest chat history from the latest system prompt, limited to specified cnt.
bCompletionFreshChatAlways - whether Completion mode collates complete/sliding-window history when
communicating with the server or only sends the latest user query/message.
tools - contains controls related to tool calling
enabled - control whether tool calling is enabled or not
@ -221,9 +224,6 @@ It is attached to the document object. Some of these can also be updated using t
apiEP - select between /completions and /chat/completions endpoint provided by the server/ai-model.
bCompletionFreshChatAlways - whether Completion mode collates complete/sliding-window history when
communicating with the server or only sends the latest user query/message.
bCompletionInsertStandardRolePrefix - whether Completion mode inserts role related prefix wrt the
messages that get inserted into prompt field wrt /Completion endpoint.

View File

@ -855,7 +855,7 @@ class MultiChatUI {
// So if user wants to simulate a multi-chat based completion query,
// they will have to enter the full thing, as a suitable multiline
// user input/query.
if ((apiEP == ApiEP.Type.Completion) && (gMe.bCompletionFreshChatAlways)) {
if ((apiEP == ApiEP.Type.Completion) && (gMe.chatProps.bCompletionFreshChatAlways)) {
chat.clear();
}
@ -1022,8 +1022,8 @@ class Me {
this.chatProps = {
stream: true,
iRecentUserMsgCnt: 10,
bCompletionFreshChatAlways: true,
};
this.bCompletionFreshChatAlways = true;
this.bCompletionInsertStandardRolePrefix = false;
this.bTrimGarbage = true;
/** @type {Object<string, number>} */
@ -1094,7 +1094,7 @@ class Me {
* @param {boolean} bAll
*/
show_info(elDiv, bAll=false) {
let props = ["baseURL", "modelInfo","headers", "tools", "apiRequestOptions", "apiEP", "chatProps", "bTrimGarbage", "bCompletionFreshChatAlways", "bCompletionInsertStandardRolePrefix"];
let props = ["baseURL", "modelInfo","headers", "tools", "apiRequestOptions", "apiEP", "chatProps", "bTrimGarbage", "bCompletionInsertStandardRolePrefix"];
if (!bAll) {
props = [ "baseURL", "modelInfo", "headers", "tools", "apiRequestOptions", "apiEP", "chatProps" ];
}
@ -1112,7 +1112,7 @@ class Me {
* @param {HTMLDivElement} elDiv
*/
show_settings(elDiv) {
ui.ui_show_obj_props_edit(elDiv, "", this, ["baseURL", "headers", "tools", "apiRequestOptions", "apiEP", "chatProps", "bTrimGarbage", "bCompletionFreshChatAlways", "bCompletionInsertStandardRolePrefix"], "Settings", (prop, elProp)=>{
ui.ui_show_obj_props_edit(elDiv, "", this, ["baseURL", "headers", "tools", "apiRequestOptions", "apiEP", "chatProps", "bTrimGarbage", "bCompletionInsertStandardRolePrefix"], "Settings", (prop, elProp)=>{
if (prop == "headers:Authorization") {
// @ts-ignore
elProp.placeholder = "Bearer OPENAI_API_KEY";