[refactor] reverse proxy 2

This commit is contained in:
kwaroran
2023-07-08 10:42:29 +09:00
parent d4a08dd620
commit f464e29483

View File

@@ -162,6 +162,7 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model'
let replacerURL = (aiModel === 'reverse_proxy') ? (db.forceReplaceUrl) : ('https://api.openai.com/v1/chat/completions')
if(aiModel === 'reverse_proxy'){
if(replacerURL.endsWith('v1')){
replacerURL += '/chat/completions'
}
@@ -176,6 +177,7 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model'
replacerURL += '/v1/chat/completions'
}
}
}
if(db.useStreaming && arg.useStreaming){
body.stream = true