Spaces:
Runtime error
Runtime error
Update api/chatgpt/api.go
Browse files- api/chatgpt/api.go +0 -3
api/chatgpt/api.go
CHANGED
@@ -124,13 +124,11 @@ func ContinueConversation(c *gin.Context, conversationID string, parentMessageID
|
|
124 |
req.Header.Set("Accept", "text/event-stream")
|
125 |
resp, err := api.Client.Do(req)
|
126 |
if err != nil {
|
127 |
-
logger.Info(fmt.Sprintf("ContinueConversationRequestError: %s", err.Error()))
|
128 |
c.AbortWithStatusJSON(http.StatusInternalServerError, api.ReturnMessage(err.Error()))
|
129 |
return
|
130 |
}
|
131 |
|
132 |
if resp.StatusCode != http.StatusOK {
|
133 |
-
logger.Info("ContinueConversationRequestStatusCode != http.StatusOK " + string(rune(resp.StatusCode)))
|
134 |
responseMap := make(map[string]interface{})
|
135 |
json.NewDecoder(resp.Body).Decode(&responseMap)
|
136 |
c.AbortWithStatusJSON(resp.StatusCode, responseMap)
|
@@ -142,7 +140,6 @@ func ContinueConversation(c *gin.Context, conversationID string, parentMessageID
|
|
142 |
Status, ParentMessageID, part := api.HandleConversationResponse(c, resp)
|
143 |
if Status {
|
144 |
resp.Body.Close()
|
145 |
-
logger.Info(fmt.Sprintf("part的值: %s", part))
|
146 |
ContinueConversation(c, *request.ConversationID, ParentMessageID, request.Model, part)
|
147 |
} else {
|
148 |
resp.Body.Close()
|
|
|
124 |
req.Header.Set("Accept", "text/event-stream")
|
125 |
resp, err := api.Client.Do(req)
|
126 |
if err != nil {
|
|
|
127 |
c.AbortWithStatusJSON(http.StatusInternalServerError, api.ReturnMessage(err.Error()))
|
128 |
return
|
129 |
}
|
130 |
|
131 |
if resp.StatusCode != http.StatusOK {
|
|
|
132 |
responseMap := make(map[string]interface{})
|
133 |
json.NewDecoder(resp.Body).Decode(&responseMap)
|
134 |
c.AbortWithStatusJSON(resp.StatusCode, responseMap)
|
|
|
140 |
Status, ParentMessageID, part := api.HandleConversationResponse(c, resp)
|
141 |
if Status {
|
142 |
resp.Body.Close()
|
|
|
143 |
ContinueConversation(c, *request.ConversationID, ParentMessageID, request.Model, part)
|
144 |
} else {
|
145 |
resp.Body.Close()
|