Spaces:
Runtime error
Runtime error
Upload 2 files
Browse files- api/chatgpt/api.go +2 -0
- api/common.go +2 -0
api/chatgpt/api.go
CHANGED
|
@@ -83,6 +83,7 @@ func CreateConversation(c *gin.Context) {
|
|
| 83 |
c.Set("oldpart", "")
|
| 84 |
Status, ConversationID, part := api.HandleConversationResponse(c, resp)
|
| 85 |
if Status {
|
|
|
|
| 86 |
ContinueConversation(c, ConversationID, request.ParentMessageID, request.Model, part)
|
| 87 |
}
|
| 88 |
}
|
|
@@ -136,6 +137,7 @@ func ContinueConversation(c *gin.Context, conversationID string, parentMessageID
|
|
| 136 |
c.Set("oldpart", oldpart)
|
| 137 |
Status, ConversationID, part := api.HandleConversationResponse(c, resp)
|
| 138 |
if Status {
|
|
|
|
| 139 |
ContinueConversation(c, ConversationID, request.ParentMessageID, request.Model, part)
|
| 140 |
}
|
| 141 |
}
|
|
|
|
| 83 |
c.Set("oldpart", "")
|
| 84 |
Status, ConversationID, part := api.HandleConversationResponse(c, resp)
|
| 85 |
if Status {
|
| 86 |
+
logger.Info(fmt.Sprintf("part的值: %s", part))
|
| 87 |
ContinueConversation(c, ConversationID, request.ParentMessageID, request.Model, part)
|
| 88 |
}
|
| 89 |
}
|
|
|
|
| 137 |
c.Set("oldpart", oldpart)
|
| 138 |
Status, ConversationID, part := api.HandleConversationResponse(c, resp)
|
| 139 |
if Status {
|
| 140 |
+
logger.Info(fmt.Sprintf("part的值: %s", part))
|
| 141 |
ContinueConversation(c, ConversationID, request.ParentMessageID, request.Model, part)
|
| 142 |
}
|
| 143 |
}
|
api/common.go
CHANGED
|
@@ -77,6 +77,8 @@ func HandleConversationResponse(c *gin.Context, resp *http.Response) (bool, stri
|
|
| 77 |
ConversationID := ""
|
| 78 |
oldpart := c.GetString("oldpart")
|
| 79 |
part := ""
|
|
|
|
|
|
|
| 80 |
c.Writer.Header().Set("Content-Type", "text/event-stream; charset=utf-8")
|
| 81 |
|
| 82 |
reader := bufio.NewReader(resp.Body)
|
|
|
|
| 77 |
ConversationID := ""
|
| 78 |
oldpart := c.GetString("oldpart")
|
| 79 |
part := ""
|
| 80 |
+
logger.Info(fmt.Sprintf("oldpart的值: %s", oldpart))
|
| 81 |
+
|
| 82 |
c.Writer.Header().Set("Content-Type", "text/event-stream; charset=utf-8")
|
| 83 |
|
| 84 |
reader := bufio.NewReader(resp.Body)
|