diff --git a/README.en.md b/README.en.md
index 1c5968bc..c43ee3af 100644
--- a/README.en.md
+++ b/README.en.md
@@ -173,7 +173,8 @@ If you encounter a blank page after deployment, refer to [#97](https://github.co
Deploy on Sealos
-Please refer to [this tutorial](https://github.com/c121914yu/FastGPT/blob/main/docs/deploy/one-api/sealos.md).
+[](https://cloud.sealos.io/?openapp=system-fastdeploy?templateName=one-api)
+
diff --git a/README.md b/README.md
index 55b2ecec..a7c06fc5 100644
--- a/README.md
+++ b/README.md
@@ -211,9 +211,9 @@ docker run --name chatgpt-web -d -p 3002:3002 -e OPENAI_API_BASE_URL=https://ope
部署到 Sealos
-> Sealos 可视化部署,仅需 1 分钟。
+> Sealos 可视化一键部署。
-参考这个[教程](https://github.com/c121914yu/FastGPT/blob/main/docs/deploy/one-api/sealos.md)中 1~5 步。
+[](https://cloud.sealos.io/?openapp=system-fastdeploy?templateName=one-api)
diff --git a/controller/relay-zhipu.go b/controller/relay-zhipu.go
index 33d141c7..20a4fa42 100644
--- a/controller/relay-zhipu.go
+++ b/controller/relay-zhipu.go
@@ -194,8 +194,8 @@ func zhipuStreamHandler(c *gin.Context, resp *http.Response) (*OpenAIErrorWithSt
if atEOF && len(data) == 0 {
return 0, nil, nil
}
- if i := strings.Index(string(data), "\n"); i >= 0 {
- return i + 1, data[0:i], nil
+ if i := strings.Index(string(data), "\n\n"); i >= 0 && strings.Index(string(data), ":") >= 0 {
+ return i + 2, data[0:i], nil
}
if atEOF {
return len(data), data, nil
@@ -208,14 +208,19 @@ func zhipuStreamHandler(c *gin.Context, resp *http.Response) (*OpenAIErrorWithSt
go func() {
for scanner.Scan() {
data := scanner.Text()
- data = strings.Trim(data, "\"")
- if len(data) < 5 { // ignore blank line or wrong format
- continue
- }
- if data[:5] == "data:" {
- dataChan <- data[5:]
- } else if data[:5] == "meta:" {
- metaChan <- data[5:]
+ lines := strings.Split(data, "\n")
+ for i, line := range lines {
+ if len(line) < 5 {
+ continue
+ }
+ if line[:5] == "data:" {
+ dataChan <- line[5:]
+ if i != len(lines)-1 {
+ dataChan <- "\n"
+ }
+ } else if line[:5] == "meta:" {
+ metaChan <- line[5:]
+ }
}
}
stopChan <- true