Spaces:
Runtime error
Runtime error
Update api/common.go
Browse files- api/common.go +6 -5
api/common.go
CHANGED
|
@@ -108,10 +108,12 @@ func HandleConversationResponse(c *gin.Context, resp *http.Response) (bool, stri
|
|
| 108 |
logger.Info(fmt.Sprintf("HandleConversationResponseContinue: %s", line))
|
| 109 |
}
|
| 110 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 111 |
if strings.HasPrefix(line, "[DONE]") {
|
| 112 |
-
|
| 113 |
-
break
|
| 114 |
-
}
|
| 115 |
} else {
|
| 116 |
if len(oldpart) > 0 {
|
| 117 |
var result map[string]interface{}
|
|
@@ -142,7 +144,7 @@ func HandleConversationResponse(c *gin.Context, resp *http.Response) (bool, stri
|
|
| 142 |
c.Writer.Flush()
|
| 143 |
|
| 144 |
if strings.HasPrefix(line, "[DONE]") {
|
| 145 |
-
|
| 146 |
}
|
| 147 |
|
| 148 |
data := line[6:]
|
|
@@ -173,7 +175,6 @@ func HandleConversationResponse(c *gin.Context, resp *http.Response) (bool, stri
|
|
| 173 |
msg_id := message["id"].(string)
|
| 174 |
c.Set("msg_id", msg_id)
|
| 175 |
}
|
| 176 |
-
break
|
| 177 |
}
|
| 178 |
}
|
| 179 |
}
|
|
|
|
| 108 |
logger.Info(fmt.Sprintf("HandleConversationResponseContinue: %s", line))
|
| 109 |
}
|
| 110 |
|
| 111 |
+
if Status {
|
| 112 |
+
continue
|
| 113 |
+
}
|
| 114 |
+
|
| 115 |
if strings.HasPrefix(line, "[DONE]") {
|
| 116 |
+
|
|
|
|
|
|
|
| 117 |
} else {
|
| 118 |
if len(oldpart) > 0 {
|
| 119 |
var result map[string]interface{}
|
|
|
|
| 144 |
c.Writer.Flush()
|
| 145 |
|
| 146 |
if strings.HasPrefix(line, "[DONE]") {
|
| 147 |
+
continue
|
| 148 |
}
|
| 149 |
|
| 150 |
data := line[6:]
|
|
|
|
| 175 |
msg_id := message["id"].(string)
|
| 176 |
c.Set("msg_id", msg_id)
|
| 177 |
}
|
|
|
|
| 178 |
}
|
| 179 |
}
|
| 180 |
}
|