[feat] new chat settings in japanese

This commit is contained in:
kwaroran
2023-06-26 00:17:06 +09:00
parent 378faae5e0
commit 90b60d71b5
3 changed files with 7 additions and 1 deletions

View File

@@ -26,7 +26,8 @@ export function exampleMessage(char:character, userName:string):OpenAIChat[]{
add()
result.push({
role: "system",
content: '[Start a new chat]'
content: '[Start a new chat]',
memo: "NewChatExample"
})
currentMessage = null
}

View File

@@ -98,6 +98,7 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model'
formated[i].content = formated[i].name + ": " + formated[i].content
}
formated[i].name = undefined
delete formated[i].memo
}
}

View File

@@ -57,6 +57,10 @@ export function unstringlizeChat(text:string, formated:OpenAIChat[], char:string
export function stringlizeAINChat(formated:OpenAIChat[], char:string = ''){
let resultString:string[] = []
for(const form of formated){
if(form.memo.startsWith("newChat")){
resultString.push("[新しいチャットの始まり]")
continue
}
if(form.role === 'system'){
resultString.push(form.content)
}