SimpleChat: highlight trim, garbage trimming bitmore aggressive
Make it easy for end user to identified the trimmed text. Make garbage trimming logic, consider a longer repeat garbage substring.
This commit is contained in:
parent
42b4fe555e
commit
f9fc543190
2 changed files with 6 additions and 2 deletions
|
@ -21,6 +21,9 @@
|
|||
.role-user {
|
||||
background-color: lightgray;
|
||||
}
|
||||
.role-trim {
|
||||
background-color: lightpink;
|
||||
}
|
||||
|
||||
.flex-grow {
|
||||
flex-grow: 1;
|
||||
|
|
|
@ -450,14 +450,15 @@ class MultiChatUI {
|
|||
}
|
||||
if (gMe.bTrimGarbage) {
|
||||
let origMsg = assistantMsg;
|
||||
assistantMsg = du.trim_hist_garbage_at_end_loop(assistantMsg, 8, 16, 72);
|
||||
assistantMsg = du.trim_hist_garbage_at_end_loop(assistantMsg, 8, 24, 72);
|
||||
trimmedMsg = origMsg.substring(assistantMsg.length);
|
||||
}
|
||||
chat.add(Roles.Assistant, assistantMsg);
|
||||
if (chatId == this.curChatId) {
|
||||
chat.show(this.elDivChat);
|
||||
if (trimmedMsg.length > 0) {
|
||||
ui.el_create_append_p(`TRIMMED:${trimmedMsg}`, this.elDivChat);
|
||||
let p = ui.el_create_append_p(`TRIMMED:${trimmedMsg}`, this.elDivChat);
|
||||
p.className="role-trim";
|
||||
}
|
||||
} else {
|
||||
console.debug(`DBUG:SimpleChat:MCUI:HandleUserSubmit:ChatId has changed:[${chatId}] [${this.curChatId}]`);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue