Enhance LLM model flags to include requiresAlternateRole and update request processing to handle multimodal and thoughts data

This commit is contained in:
Kwaroran
2024-12-20 04:31:23 +09:00
parent 280fd31316
commit cc4bbdc8e2
2 changed files with 33 additions and 17 deletions

View File

@@ -282,7 +282,23 @@ function reformater(formated:OpenAIChat[],modelInfo:LLMModel){
}
if(newFormated[newFormated.length-1].role === m.role){
newFormated[newFormated.length-1].content += '\n' + m.content
if(m.multimodals){
if(!newFormated[newFormated.length-1].multimodals){
newFormated[newFormated.length-1].multimodals = []
}
newFormated[newFormated.length-1].multimodals.push(...m.multimodals)
}
if(m.thoughts){
if(!newFormated[newFormated.length-1].thoughts){
newFormated[newFormated.length-1].thoughts = []
}
newFormated[newFormated.length-1].thoughts.push(...m.thoughts)
}
continue
}
else{