Add model support

This commit is contained in:
kwaroran
2024-04-09 05:49:01 +09:00
parent 86c0e366cc
commit 28241011cf
3 changed files with 48 additions and 1 deletions

View File

@@ -1439,6 +1439,48 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model'
'result': result
}
}
case 'risullm-proto':{
const res = await globalFetch('https://sv.risuai.xyz/risullm', {
body: {
messages: formated.map((v) => {
if(v.role === 'system'){
return {
role: "user",
content: "System: " + v.content
}
}
if(v.role === 'function'){
return {
role: "user",
content: "Function: " + v.content
}
}
return {
role: v.role,
content: v.content
}
})
},
headers: {
"X-Api-Key": db.proxyKey
}
})
const resp:string = res?.data?.response
if(!resp){
return {
type: 'fail',
result: JSON.stringify(res.data)
}
}
return {
type: 'success',
result: resp.replace(/\\n/g, '\n')
}
}
default:{
if(raiModel.startsWith('claude-3')){
let replacerURL = (aiModel === 'reverse_proxy') ? (db.forceReplaceUrl) : ('https://api.anthropic.com/v1/messages')