[refactor] reverse proxy 2
This commit is contained in:
@@ -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')
|
let replacerURL = (aiModel === 'reverse_proxy') ? (db.forceReplaceUrl) : ('https://api.openai.com/v1/chat/completions')
|
||||||
|
|
||||||
|
if(aiModel === 'reverse_proxy'){
|
||||||
if(replacerURL.endsWith('v1')){
|
if(replacerURL.endsWith('v1')){
|
||||||
replacerURL += '/chat/completions'
|
replacerURL += '/chat/completions'
|
||||||
}
|
}
|
||||||
@@ -176,6 +177,7 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model'
|
|||||||
replacerURL += '/v1/chat/completions'
|
replacerURL += '/v1/chat/completions'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(db.useStreaming && arg.useStreaming){
|
if(db.useStreaming && arg.useStreaming){
|
||||||
body.stream = true
|
body.stream = true
|
||||||
|
|||||||
Reference in New Issue
Block a user