♻️ refactor: 重构http请求函数

This commit is contained in:
Martial BE
2023-11-30 13:49:35 +08:00
parent 96dc7614e6
commit 7c6dee7390
17 changed files with 116 additions and 143 deletions

View File

@@ -111,7 +111,7 @@ func (p *TencentProvider) ChatAction(request *types.ChatCompletionRequest, isMod
} else {
tencentResponse := &TencentChatResponse{}
errWithCode = p.SendRequest(req, tencentResponse)
errWithCode = p.SendRequest(req, tencentResponse, false)
if errWithCode != nil {
return
}
@@ -147,7 +147,7 @@ func (p *TencentProvider) sendStreamRequest(req *http.Request) (*types.OpenAIErr
}
if common.IsFailureStatusCode(resp) {
return p.HandleErrorResp(resp), ""
return common.HandleErrorResp(resp), ""
}
defer resp.Body.Close()