[fix] example

This commit is contained in:
kwaroran
2023-12-24 23:25:07 +09:00
parent f7fe9533dc
commit 87d32a5c58

View File

@@ -1283,7 +1283,10 @@ function systemizeChat(chat:OpenAIChat[]){
for(let i=0;i<chat.length;i++){
if(chat[i].role === 'user' || chat[i].role === 'assistant'){
const attr = chat[i].attr ?? []
if(!attr.includes('nameAdded')){
if(chat[i].name?.startsWith('example_')){
chat[i].content = chat[i].name + ': ' + chat[i].content
}
else if(!attr.includes('nameAdded')){
chat[i].content = chat[i].role + ': ' + chat[i].content
}
chat[i].role = 'system'