mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-13 20:03:44 +08:00
♻️ refactor: 重构http请求函数
This commit is contained in:
@@ -95,7 +95,7 @@ func (p *BaiduProvider) ChatAction(request *types.ChatCompletionRequest, isModel
|
||||
|
||||
} else {
|
||||
baiduChatRequest := &BaiduChatResponse{}
|
||||
errWithCode = p.SendRequest(req, baiduChatRequest)
|
||||
errWithCode = p.SendRequest(req, baiduChatRequest, false)
|
||||
if errWithCode != nil {
|
||||
return
|
||||
}
|
||||
@@ -132,7 +132,7 @@ func (p *BaiduProvider) sendStreamRequest(req *http.Request) (usage *types.Usage
|
||||
}
|
||||
|
||||
if common.IsFailureStatusCode(resp) {
|
||||
return nil, p.HandleErrorResp(resp)
|
||||
return nil, common.HandleErrorResp(resp)
|
||||
}
|
||||
|
||||
defer resp.Body.Close()
|
||||
|
||||
Reference in New Issue
Block a user