SimpleChatTC:Show: Cleanup
Update existing flow so that next Tool Role message is handled directly from within
This commit is contained in:
parent
aa17edfa78
commit
62bce9ebfb
|
|
@ -367,7 +367,7 @@ class SimpleChat {
|
||||||
if (iRecentUserMsgCnt == 0) {
|
if (iRecentUserMsgCnt == 0) {
|
||||||
console.warn("WARN:SimpleChat:SC:RecentChat:iRecentUsermsgCnt of 0 means no user message/query sent");
|
console.warn("WARN:SimpleChat:SC:RecentChat:iRecentUsermsgCnt of 0 means no user message/query sent");
|
||||||
}
|
}
|
||||||
/** @type{ChatMessages} */
|
/** @type {ChatMessages} */
|
||||||
let rchat = [];
|
let rchat = [];
|
||||||
let sysMsg = this.get_system_latest();
|
let sysMsg = this.get_system_latest();
|
||||||
if (sysMsg.ns.content.length != 0) {
|
if (sysMsg.ns.content.length != 0) {
|
||||||
|
|
@ -493,16 +493,16 @@ class SimpleChat {
|
||||||
div.replaceChildren();
|
div.replaceChildren();
|
||||||
}
|
}
|
||||||
let last = undefined;
|
let last = undefined;
|
||||||
for(const x of this.recent_chat(gMe.chatProps.iRecentUserMsgCnt)) {
|
for(const [i, x] of this.recent_chat(gMe.chatProps.iRecentUserMsgCnt).entries()) {
|
||||||
if (x.ns.role != Roles.ToolTemp) {
|
if (x.ns.role === Roles.ToolTemp) {
|
||||||
|
if (i == (this.xchat.length - 1)) {
|
||||||
|
elInUser.value = x.ns.content;
|
||||||
|
}
|
||||||
|
continue
|
||||||
|
}
|
||||||
let entry = ui.el_create_append_p(`${x.ns.role}: ${x.content_equiv()}`, div);
|
let entry = ui.el_create_append_p(`${x.ns.role}: ${x.content_equiv()}`, div);
|
||||||
entry.className = `role-${x.ns.role}`;
|
entry.className = `role-${x.ns.role}`;
|
||||||
last = entry;
|
last = entry;
|
||||||
} else {
|
|
||||||
if (elInUser) {
|
|
||||||
elInUser.value = x.ns.content;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (last !== undefined) {
|
if (last !== undefined) {
|
||||||
last.scrollIntoView(false);
|
last.scrollIntoView(false);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue