SimpleChatTC:Cleanup:ChatProps: bCompletionInsertStandardRolePrefix
This commit is contained in:
parent
734f74c908
commit
82be13aa33
|
|
@ -205,6 +205,9 @@ It is attached to the document object. Some of these can also be updated using t
|
|||
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.
|
||||
|
||||
tools - contains controls related to tool calling
|
||||
|
||||
enabled - control whether tool calling is enabled or not
|
||||
|
|
@ -224,9 +227,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.
|
||||
|
||||
bCompletionInsertStandardRolePrefix - whether Completion mode inserts role related prefix wrt the
|
||||
messages that get inserted into prompt field wrt /Completion endpoint.
|
||||
|
||||
bTrimGarbage - whether garbage repeatation at the end of the generated ai response, should be
|
||||
trimmed or left as is. If enabled, it will be trimmed so that it wont be sent back as part of
|
||||
subsequent chat history. At the same time the actual trimmed text is shown to the user, once
|
||||
|
|
|
|||
|
|
@ -509,7 +509,7 @@ class SimpleChat {
|
|||
if (apiEP == ApiEP.Type.Chat) {
|
||||
return this.request_messages_jsonstr();
|
||||
} else {
|
||||
return this.request_prompt_jsonstr(gMe.bCompletionInsertStandardRolePrefix);
|
||||
return this.request_prompt_jsonstr(gMe.chatProps.bCompletionInsertStandardRolePrefix);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1023,8 +1023,8 @@ class Me {
|
|||
stream: true,
|
||||
iRecentUserMsgCnt: 10,
|
||||
bCompletionFreshChatAlways: true,
|
||||
bCompletionInsertStandardRolePrefix: false,
|
||||
};
|
||||
this.bCompletionInsertStandardRolePrefix = false;
|
||||
this.bTrimGarbage = true;
|
||||
/** @type {Object<string, number>} */
|
||||
this.sRecentUserMsgCnt = {
|
||||
|
|
@ -1094,7 +1094,7 @@ class Me {
|
|||
* @param {boolean} bAll
|
||||
*/
|
||||
show_info(elDiv, bAll=false) {
|
||||
let props = ["baseURL", "modelInfo","headers", "tools", "apiRequestOptions", "apiEP", "chatProps", "bTrimGarbage", "bCompletionInsertStandardRolePrefix"];
|
||||
let props = ["baseURL", "modelInfo","headers", "tools", "apiRequestOptions", "apiEP", "chatProps", "bTrimGarbage"];
|
||||
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", "bCompletionInsertStandardRolePrefix"], "Settings", (prop, elProp)=>{
|
||||
ui.ui_show_obj_props_edit(elDiv, "", this, ["baseURL", "headers", "tools", "apiRequestOptions", "apiEP", "chatProps", "bTrimGarbage"], "Settings", (prop, elProp)=>{
|
||||
if (prop == "headers:Authorization") {
|
||||
// @ts-ignore
|
||||
elProp.placeholder = "Bearer OPENAI_API_KEY";
|
||||
|
|
|
|||
Loading…
Reference in New Issue