Spaces:
Runtime error
Runtime error
Upload 2 files
Browse files- api/chatgpt/api.go +2 -0
api/chatgpt/api.go
CHANGED
|
@@ -121,12 +121,14 @@ func ContinueConversation(c *gin.Context, conversationID string, parentMessageID
|
|
| 121 |
req.Header.Set("Accept", "text/event-stream")
|
| 122 |
resp, err := api.Client.Do(req)
|
| 123 |
if err != nil {
|
|
|
|
| 124 |
c.AbortWithStatusJSON(http.StatusInternalServerError, api.ReturnMessage(err.Error()))
|
| 125 |
return
|
| 126 |
}
|
| 127 |
|
| 128 |
defer resp.Body.Close()
|
| 129 |
if resp.StatusCode != http.StatusOK {
|
|
|
|
| 130 |
responseMap := make(map[string]interface{})
|
| 131 |
json.NewDecoder(resp.Body).Decode(&responseMap)
|
| 132 |
c.AbortWithStatusJSON(resp.StatusCode, responseMap)
|
|
|
|
| 121 |
req.Header.Set("Accept", "text/event-stream")
|
| 122 |
resp, err := api.Client.Do(req)
|
| 123 |
if err != nil {
|
| 124 |
+
logger.Info(fmt.Sprintf("ContinueConversationRequestError: %s", err.Error()))
|
| 125 |
c.AbortWithStatusJSON(http.StatusInternalServerError, api.ReturnMessage(err.Error()))
|
| 126 |
return
|
| 127 |
}
|
| 128 |
|
| 129 |
defer resp.Body.Close()
|
| 130 |
if resp.StatusCode != http.StatusOK {
|
| 131 |
+
logger.Info(fmt.Sprintf("ContinueConversationRequestStatusCode != http.StatusOK"))
|
| 132 |
responseMap := make(map[string]interface{})
|
| 133 |
json.NewDecoder(resp.Body).Decode(&responseMap)
|
| 134 |
c.AbortWithStatusJSON(resp.StatusCode, responseMap)
|