mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
indicator for last message in chat context (WIP)
This commit is contained in:
@@ -1726,8 +1726,14 @@ async function Generate(type, automatic_trigger, force_name2) {
|
|||||||
if (canFitMessages()) { //(The number of tokens in the entire promt) need fix, it must count correctly (added +120, so that the description of the character does not hide)
|
if (canFitMessages()) { //(The number of tokens in the entire promt) need fix, it must count correctly (added +120, so that the description of the character does not hide)
|
||||||
//if (is_pygmalion && i == chat2.length-1) item='<START>\n'+item;
|
//if (is_pygmalion && i == chat2.length-1) item='<START>\n'+item;
|
||||||
arrMes[arrMes.length] = item;
|
arrMes[arrMes.length] = item;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
$("#chat").children().removeClass('lastInContext');
|
||||||
|
console.log(arrMes.length);
|
||||||
|
|
||||||
|
$(`#chat .mes:nth-last-of-type(${arrMes.length + 1})`).addClass('lastInContext');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
await delay(1); //For disable slow down (encode gpt-2 need fix)
|
await delay(1); //For disable slow down (encode gpt-2 need fix)
|
||||||
}
|
}
|
||||||
@@ -1821,6 +1827,7 @@ async function Generate(type, automatic_trigger, force_name2) {
|
|||||||
let mesSendString = '';
|
let mesSendString = '';
|
||||||
|
|
||||||
function setPromtString() {
|
function setPromtString() {
|
||||||
|
console.log('--setting Prompt string');
|
||||||
mesExmString = pinExmString ?? mesExamplesArray.slice(0, count_exm_add).join('');
|
mesExmString = pinExmString ?? mesExamplesArray.slice(0, count_exm_add).join('');
|
||||||
mesSendString = '';
|
mesSendString = '';
|
||||||
for (let j = 0; j < mesSend.length; j++) {
|
for (let j = 0; j < mesSend.length; j++) {
|
||||||
@@ -1844,6 +1851,7 @@ async function Generate(type, automatic_trigger, force_name2) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function checkPromtSize() {
|
function checkPromtSize() {
|
||||||
|
console.log('---checking Prompt size');
|
||||||
setPromtString();
|
setPromtString();
|
||||||
const prompt = [
|
const prompt = [
|
||||||
worldInfoString,
|
worldInfoString,
|
||||||
@@ -1868,15 +1876,16 @@ async function Generate(type, automatic_trigger, force_name2) {
|
|||||||
checkPromtSize(); // and check size again..
|
checkPromtSize(); // and check size again..
|
||||||
} else {
|
} else {
|
||||||
//end
|
//end
|
||||||
|
console.log(`---mesSend.length = ${mesSend.length}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (generatedPromtCache.length > 0) {
|
if (generatedPromtCache.length > 0) {
|
||||||
//console.log('Generated Prompt Cache length: '+generatedPromtCache.length);
|
console.log('---Generated Prompt Cache length: ' + generatedPromtCache.length);
|
||||||
checkPromtSize();
|
checkPromtSize();
|
||||||
} else {
|
} else {
|
||||||
//console.log('calling setPromtString')
|
console.log('---calling setPromtString ' + generatedPromtCache.length)
|
||||||
setPromtString();
|
setPromtString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -3956,6 +3956,10 @@ body.waifuMode #avatar_zoom_popup {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.lastInContext {
|
||||||
|
border-top: 5px dashed var(--SmartThemeQuoteColor) !important;
|
||||||
|
}
|
||||||
|
|
||||||
@media screen and (max-width: 1000px) and (orientation: landscape) {
|
@media screen and (max-width: 1000px) and (orientation: landscape) {
|
||||||
body.waifuMode img.expression {
|
body.waifuMode img.expression {
|
||||||
object-fit: contain;
|
object-fit: contain;
|
||||||
|
Reference in New Issue
Block a user