Fix: AI provider call failure error not returning

This commit is contained in:
Liujian
2025-02-08 15:28:47 +08:00
parent f2328a3d1e
commit 11ad824428
15 changed files with 177 additions and 45 deletions

View File

@@ -4,6 +4,7 @@ import (
"bytes"
"net/http"
"strconv"
"strings"
"time"
"github.com/valyala/fasthttp"
@@ -20,7 +21,7 @@ type requestAgent struct {
statusCode int
status string
responseLength int
responseBody string
responseBody strings.Builder
beginTime time.Time
endTime time.Time
hostAgent *UrlAgent
@@ -31,7 +32,7 @@ type requestAgent struct {
}
func (a *requestAgent) ResponseBody() string {
return a.responseBody
return a.responseBody.String()
}
func (a *requestAgent) ResponseHeaders() http.Header {