[feat] new parser

This commit is contained in:
kwaroran
2023-07-16 22:23:51 +09:00
parent 098901b9ab
commit f277a928dd
4 changed files with 202 additions and 70 deletions

View File

@@ -1,6 +1,6 @@
import type { OpenAIChat } from ".";
import type { character } from "../storage/database";
import { replacePlaceholders } from "../util";
import { risuChatParser } from "./scripts";
export function exampleMessage(char:character, userName:string):OpenAIChat[]{
if(char.exampleMessage === ''){
@@ -58,7 +58,7 @@ export function exampleMessage(char:character, userName:string):OpenAIChat[]{
result = result.map((r) => {
return {
role: r.role,
content: replacePlaceholders(r.content, char.name)
content: risuChatParser(r.content, {chara: char})
}
})