SimpleChat: Allow for chat req bool options to be user controlled
This commit is contained in:
parent
2df373ac40
commit
abe6c54c4c
2 changed files with 20 additions and 11 deletions
|
@ -177,10 +177,15 @@ It is attached to the document object. Some of these can also be updated using t
|
||||||
modify the existing options value or remove them, for now you can update this global var
|
modify the existing options value or remove them, for now you can update this global var
|
||||||
using browser's development-tools/console.
|
using browser's development-tools/console.
|
||||||
|
|
||||||
For string and numeric fields in chatRequestOptions, including even those added by a user
|
For string, numeric and boolean fields in chatRequestOptions, including even those added by a
|
||||||
at runtime by directly modifying gMe.chatRequestOptions, setting ui entries will be auto
|
user at runtime by directly modifying gMe.chatRequestOptions, setting ui entries will be auto
|
||||||
created.
|
created.
|
||||||
|
|
||||||
|
cache_prompt option supported by example/server is allowed to be controlled by user. So that
|
||||||
|
any caching supported with system-prompt and chat history if usable can get used. If one has
|
||||||
|
enabled chat history sliding window, then the chat history caching may or maynot kick in at
|
||||||
|
the backend, based on aspects related to positional encoding, attention mechanism etal.
|
||||||
|
|
||||||
headers - maintains the list of http headers sent when request is made to the server. By default
|
headers - maintains the list of http headers sent when request is made to the server. By default
|
||||||
Content-Type is set to application/json. Additionally Authorization entry is provided, which can
|
Content-Type is set to application/json. Additionally Authorization entry is provided, which can
|
||||||
be set if needed using the settings ui.
|
be set if needed using the settings ui.
|
||||||
|
|
|
@ -835,9 +835,7 @@ class Me {
|
||||||
for(const k in this.chatRequestOptions) {
|
for(const k in this.chatRequestOptions) {
|
||||||
let val = this.chatRequestOptions[k];
|
let val = this.chatRequestOptions[k];
|
||||||
let type = typeof(val);
|
let type = typeof(val);
|
||||||
if (!((type == "string") || (type == "number"))) {
|
if (((type == "string") || (type == "number"))) {
|
||||||
continue;
|
|
||||||
}
|
|
||||||
let inp = ui.el_creatediv_input(`Set${k}`, k, typeDict[type], this.chatRequestOptions[k], (val)=>{
|
let inp = ui.el_creatediv_input(`Set${k}`, k, typeDict[type], this.chatRequestOptions[k], (val)=>{
|
||||||
if (type == "number") {
|
if (type == "number") {
|
||||||
val = Number(val);
|
val = Number(val);
|
||||||
|
@ -845,6 +843,12 @@ class Me {
|
||||||
this.chatRequestOptions[k] = val;
|
this.chatRequestOptions[k] = val;
|
||||||
});
|
});
|
||||||
fs.appendChild(inp.div);
|
fs.appendChild(inp.div);
|
||||||
|
} else if (type == "boolean") {
|
||||||
|
let bbtn = ui.el_creatediv_boolbutton(`Set{k}`, k, {true: "true", false: "false"}, val, (userVal)=>{
|
||||||
|
this.chatRequestOptions[k] = userVal;
|
||||||
|
});
|
||||||
|
fs.appendChild(bbtn.div);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue