fix: Improve OpenAI stream data parsing

This commit is contained in:
QistChan
2025-02-24 01:45:24 +00:00
parent 8df4a2670b
commit 1ac79a8126
2 changed files with 9 additions and 1 deletions

View File

@@ -34,7 +34,7 @@ func StreamHandler(c *gin.Context, resp *http.Response, relayMode int) (*model.E
doneRendered := false
for scanner.Scan() {
data := scanner.Text()
data := NormalizeDataLine(scanner.Text())
if len(data) < dataPrefixLength { // ignore blank line or wrong format
continue
}