is_user 'name' saved as name1 in chat JSONL

This commit is contained in:
RossAscends
2023-05-04 23:54:44 +09:00
parent 370033f857
commit 60fdc391ba

View File

@ -2660,9 +2660,9 @@ async function saveChat(chat_name, withMetadata) {
throw new Error('Group chat saved from saveChat'); throw new Error('Group chat saved from saveChat');
} }
if (item.is_user) { if (item.is_user) {
var str = item.mes.replace(`${name1}:`, `${default_user_name}:`); var str = item.mes.replace(`${name1}:`, `${name1}:`);
chat[i].mes = str; chat[i].mes = str;
chat[i].name = default_user_name; chat[i].name = name1;
} else if (i !== chat.length - 1 && chat[i].swipe_id !== undefined) { } else if (i !== chat.length - 1 && chat[i].swipe_id !== undefined) {
// delete chat[i].swipes; // delete chat[i].swipes;
// delete chat[i].swipe_id; // delete chat[i].swipe_id;
@ -2670,7 +2670,7 @@ async function saveChat(chat_name, withMetadata) {
}); });
var save_chat = [ var save_chat = [
{ {
user_name: default_user_name, user_name: name1,
character_name: name2, character_name: name2,
create_date: chat_create_date, create_date: chat_create_date,
chat_metadata: metadata, chat_metadata: metadata,