mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-13 20:03:44 +08:00
✨ add channel proxy
This commit is contained in:
@@ -130,10 +130,12 @@ func (p *BaiduProvider) sendStreamRequest(req *http.Request, model string) (usag
|
||||
|
||||
usage = &types.Usage{}
|
||||
// 发送请求
|
||||
resp, err := common.HttpClient.Do(req)
|
||||
client := common.GetHttpClient(p.Channel.Proxy)
|
||||
resp, err := client.Do(req)
|
||||
if err != nil {
|
||||
return nil, common.ErrorWrapper(err, "http_request_failed", http.StatusInternalServerError)
|
||||
}
|
||||
common.PutHttpClient(client)
|
||||
|
||||
if common.IsFailureStatusCode(resp) {
|
||||
return nil, common.HandleErrorResp(resp)
|
||||
|
||||
Reference in New Issue
Block a user