[feat] better proxy resolve
This commit is contained in:
@@ -88,9 +88,17 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model'
|
||||
if(replacerURL.endsWith('v1')){
|
||||
replacerURL += '/chat/completions'
|
||||
}
|
||||
if(replacerURL.endsWith('v1/')){
|
||||
else if(replacerURL.endsWith('v1/')){
|
||||
replacerURL += 'chat/completions'
|
||||
}
|
||||
else if(!(replacerURL.endsWith('completions') || replacerURL.endsWith('completions/'))){
|
||||
if(replacerURL.endsWith('/')){
|
||||
replacerURL += 'v1/chat/completions'
|
||||
}
|
||||
else{
|
||||
replacerURL += '/v1/chat/completions'
|
||||
}
|
||||
}
|
||||
|
||||
if(db.useStreaming && arg.useStreaming){
|
||||
body.stream = true
|
||||
@@ -127,6 +135,8 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model'
|
||||
control.enqueue(readed)
|
||||
return
|
||||
}
|
||||
|
||||
console.log(rawChunk)
|
||||
const chunk = JSON.parse(rawChunk).choices[0].delta.content
|
||||
if(chunk){
|
||||
readed += chunk
|
||||
|
||||
Reference in New Issue
Block a user