Procházet zdrojové kódy

fix(server) : not show alert when DONE is received (#10674)

Plamen Minev před 1 rokem
rodič
revize
7736837d62
1 změnil soubory, kde provedl 3 přidání a 0 odebrání
  1. 3 0
      examples/server/public_simplechat/simplechat.js

+ 3 - 0
examples/server/public_simplechat/simplechat.js

@@ -407,6 +407,9 @@ class SimpleChat {
                 if (curLine.startsWith("data:")) {
                     curLine = curLine.substring(5);
                 }
+                if (curLine.trim() === "[DONE]") {
+                    break;
+                }
                 let curJson = JSON.parse(curLine);
                 console.debug("DBUG:SC:PART:Json:", curJson);
                 this.append_response(this.response_extract_stream(curJson, apiEP));