[fix] name appending wrong

This commit is contained in:
kwaroran
2023-12-24 22:07:12 +09:00
parent 464fcccf6d
commit 036fc00f7b
6 changed files with 37 additions and 12 deletions

View File

@@ -110,6 +110,7 @@ export interface OpenAIChatExtra {
memo?:string
name?:string
removable?:boolean
attr?:string[]
}
@@ -133,6 +134,7 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model'
raiModel = 'reverse_proxy'
}
}
console.log(formated)
switch(raiModel){
case 'gpt35':
case 'gpt35_0613':
@@ -153,7 +155,6 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model'
case 'mistral-medium':
case 'reverse_proxy':{
let formatedChat:OpenAIChatExtra[] = []
console.log(formated)
if(db.inlayImage){
let pendingImages:OpenAIImageContents[] = []
for(let i=0;i<formated.length;i++){
@@ -192,10 +193,6 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model'
let oobaSystemPrompts:string[] = []
for(let i=0;i<formatedChat.length;i++){
if(formatedChat[i].role !== 'function'){
if(arg.isGroupChat && formatedChat[i].name){
formatedChat[i].content = formatedChat[i].name + ": " + formatedChat[i].content
formatedChat[i].name = undefined
}
if(!(formatedChat[i].name && formatedChat[i].name.startsWith('example_') && db.newOAIHandle)){
formatedChat[i].name = undefined
}
@@ -204,6 +201,7 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model'
}
delete formatedChat[i].memo
delete formatedChat[i].removable
delete formatedChat[i].attr
}
if(aiModel === 'reverse_proxy' && db.reverseProxyOobaMode && formatedChat[i].role === 'system'){
const cont = formatedChat[i].content