Change first message to chat dependent
This commit is contained in:
@@ -612,7 +612,7 @@ export async function sendChat(chatProcessIndex = -1,arg:{
|
||||
}
|
||||
|
||||
if(nowChatroom.type !== 'group'){
|
||||
const firstMsg = nowChatroom.firstMsgIndex === -1 ? nowChatroom.firstMessage : nowChatroom.alternateGreetings[nowChatroom.firstMsgIndex]
|
||||
const firstMsg = currentChat.fmIndex === -1 ? nowChatroom.firstMessage : nowChatroom.alternateGreetings[currentChat.fmIndex]
|
||||
|
||||
const chat:OpenAIChat = {
|
||||
role: 'assistant',
|
||||
|
||||
@@ -383,7 +383,7 @@ export async function loadLoreBookV3Prompt(){
|
||||
if(Number.isNaN(int)){
|
||||
return false
|
||||
}
|
||||
if(((char.firstMsgIndex ?? -1) + 1) !== int){
|
||||
if(((char.chats[page].fmIndex ?? -1) + 1) !== int){
|
||||
activated = false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import { getChatVar, hasher, risuChatParser, setChatVar, type simpleCharacterArg
|
||||
import { LuaEngine, LuaFactory } from "wasmoon";
|
||||
import { DataBase, setDatabase, type Chat, type character, type groupChat } from "../storage/database";
|
||||
import { get } from "svelte/store";
|
||||
import { CurrentCharacter, CurrentChat, CurrentVariablePointer, ReloadGUIPointer, selectedCharID } from "../stores";
|
||||
import { CurrentCharacter, CurrentChat, ReloadGUIPointer, selectedCharID } from "../stores";
|
||||
import { alertError, alertInput, alertNormal } from "../alert";
|
||||
import { HypaProcesser } from "./memory/hypamemory";
|
||||
import { generateAIImage } from "./stableDiff";
|
||||
|
||||
@@ -180,7 +180,7 @@ export async function processScriptFull(char:character|groupChat|simpleCharacter
|
||||
const v = outScript.split(' ', 2)[1]
|
||||
const selchar = db.characters[get(selectedCharID)]
|
||||
const chat = selchar.chats[selchar.chatPage]
|
||||
let lastChat = selchar.firstMsgIndex === -1 ? selchar.firstMessage : selchar.alternateGreetings[selchar.firstMsgIndex]
|
||||
let lastChat = chat.fmIndex === -1 ? selchar.firstMessage : selchar.alternateGreetings[chat.fmIndex]
|
||||
let pointer = chatID - 1
|
||||
while(pointer >= 0){
|
||||
if(chat.message[pointer].role === chat.message[chatID].role){
|
||||
|
||||
Reference in New Issue
Block a user