🎨 结构中继控制器

This commit is contained in:
MartialBE
2023-12-02 03:28:18 +08:00
parent 2114bc1982
commit be364ae09b
45 changed files with 1267 additions and 204 deletions

View File

@@ -97,7 +97,7 @@ func (p *AliProvider) ChatAction(request *types.ChatCompletionRequest, isModelMa
client := common.NewClient()
req, err := client.NewRequest(p.Context.Request.Method, fullRequestURL, common.WithBody(requestBody), common.WithHeader(headers))
if err != nil {
return nil, types.ErrorWrapper(err, "new_request_failed", http.StatusInternalServerError)
return nil, common.ErrorWrapper(err, "new_request_failed", http.StatusInternalServerError)
}
if request.Stream {
@@ -157,7 +157,7 @@ func (p *AliProvider) sendStreamRequest(req *http.Request) (usage *types.Usage,
// 发送请求
resp, err := common.HttpClient.Do(req)
if err != nil {
return nil, types.ErrorWrapper(err, "http_request_failed", http.StatusInternalServerError)
return nil, common.ErrorWrapper(err, "http_request_failed", http.StatusInternalServerError)
}
if common.IsFailureStatusCode(resp) {