Move DeveloperRole
This commit is contained in:
@@ -502,6 +502,17 @@ async function requestOpenAI(arg:RequestDataArgumentExtended):Promise<requestDat
|
|||||||
openrouterRequestModel = await getFreeOpenRouterModel()
|
openrouterRequestModel = await getFreeOpenRouterModel()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(arg.modelInfo.flags.includes(LLMFlags.DeveloperRole)){
|
||||||
|
formatedChat = formatedChat.map((v) => {
|
||||||
|
if(v.role === 'system'){
|
||||||
|
return {
|
||||||
|
...v,
|
||||||
|
role: 'developer'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
console.log(formatedChat)
|
console.log(formatedChat)
|
||||||
if(arg.modelInfo.format === LLMFormat.Mistral){
|
if(arg.modelInfo.format === LLMFormat.Mistral){
|
||||||
requestModel = aiModel
|
requestModel = aiModel
|
||||||
@@ -555,17 +566,6 @@ async function requestOpenAI(arg:RequestDataArgumentExtended):Promise<requestDat
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(arg.modelInfo.flags.includes(LLMFlags.DeveloperRole)){
|
|
||||||
reformatedChat = reformatedChat.map((v) => {
|
|
||||||
if(v.role === 'system'){
|
|
||||||
return {
|
|
||||||
...v,
|
|
||||||
role: 'developer'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const res = await globalFetch(arg.customURL ?? "https://api.mistral.ai/v1/chat/completions", {
|
const res = await globalFetch(arg.customURL ?? "https://api.mistral.ai/v1/chat/completions", {
|
||||||
body: applyParameters({
|
body: applyParameters({
|
||||||
|
|||||||
Reference in New Issue
Block a user