mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Properly highlight last OpenAI message
This commit is contained in:
@ -33,6 +33,7 @@ import {
|
||||
export {
|
||||
is_get_status_openai,
|
||||
openai_msgs,
|
||||
openai_messages_count,
|
||||
oai_settings,
|
||||
loadOpenAISettings,
|
||||
setOpenAIMessages,
|
||||
@ -45,6 +46,7 @@ export {
|
||||
|
||||
let openai_msgs = [];
|
||||
let openai_msgs_example = [];
|
||||
let openai_messages_count = 0;
|
||||
|
||||
let is_get_status_openai = false;
|
||||
let is_api_button_press_openai = false;
|
||||
@ -414,6 +416,8 @@ async function prepareOpenAIMessages(name2, storyString, worldInfoBefore, worldI
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
openai_messages_count = openai_msgs_tosend.filter(x => x.role == "user" || x.role == "assistant").length;
|
||||
// reverse the messages array because we had the newest at the top to remove the oldest,
|
||||
// now we want proper order
|
||||
openai_msgs_tosend.reverse();
|
||||
|
Reference in New Issue
Block a user