diff --git a/searx/webapp.py b/searx/webapp.py index 30b1a7390..d7f469cf6 100755 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -1363,6 +1363,7 @@ function modal_open(url, num) if (done) return; const text = new TextDecoder('utf-8').decode(value); text.trim().split('\n').forEach(function(v) { + result = '' if(v.length>6) result = v.slice(6); if(result == "[DONE]") { @@ -1698,6 +1699,7 @@ prev_chat = prev_chat+'
'+document.querySelector("#pro if (done) return; const text = new TextDecoder('utf-8').decode(value); text.trim().split('\n').forEach(function(v) { + result = '' if(v.length>6) result = v.slice(6); if(result == "[DONE]") { @@ -1819,6 +1821,7 @@ prev_chat = prev_chat+'
'+document.querySelector("#pro if (done) return; const text = new TextDecoder('utf-8').decode(value); text.trim().split('\n').forEach(function(v) { + result = '' if(v.length>6) result = v.slice(6); if(result == "[DONE]") { @@ -1907,6 +1910,7 @@ prev_chat = prev_chat+'
'+document.querySelector("#pro if (done) return; const text = new TextDecoder('utf-8').decode(value); text.trim().split('\n').forEach(function(v) { + result = '' if(v.length>6) result = v.slice(6); if(result == "[DONE]") { @@ -2080,6 +2084,7 @@ fetch("https://search.kg/completions", optionsIntro) if (done) return; const textIntro = new TextDecoder('utf-8').decode(value); textIntro.trim().split('\n').forEach(function(v) { + result = '' if(v.length>6) result = v.slice(6); if(result == "[DONE]") { @@ -2100,6 +2105,7 @@ fetch("https://search.kg/completions", optionsIntro) if (done) return; const text = new TextDecoder('utf-8').decode(value); text.trim().split('\n').forEach(function(v) { + result='' if(v.length>6) result = v.slice(6); if(result == "[DONE]") { @@ -2128,6 +2134,7 @@ fetch("https://search.kg/completions", optionsIntro) if (done) return; const textPlusComment = new TextDecoder('utf-8').decode(value); textPlusComment.trim().split('\n').forEach(function(v) { + result = '' if(v.length>6) result = v.slice(6); if(result == "[DONE]") { diff --git a/searx/webapp1.py b/searx/webapp1.py index 30b1a7390..d7f469cf6 100644 --- a/searx/webapp1.py +++ b/searx/webapp1.py @@ -1363,6 +1363,7 @@ function modal_open(url, num) if (done) return; const text = new TextDecoder('utf-8').decode(value); text.trim().split('\n').forEach(function(v) { + result = '' if(v.length>6) result = v.slice(6); if(result == "[DONE]") { @@ -1698,6 +1699,7 @@ prev_chat = prev_chat+'
'+document.querySelector("#pro if (done) return; const text = new TextDecoder('utf-8').decode(value); text.trim().split('\n').forEach(function(v) { + result = '' if(v.length>6) result = v.slice(6); if(result == "[DONE]") { @@ -1819,6 +1821,7 @@ prev_chat = prev_chat+'
'+document.querySelector("#pro if (done) return; const text = new TextDecoder('utf-8').decode(value); text.trim().split('\n').forEach(function(v) { + result = '' if(v.length>6) result = v.slice(6); if(result == "[DONE]") { @@ -1907,6 +1910,7 @@ prev_chat = prev_chat+'
'+document.querySelector("#pro if (done) return; const text = new TextDecoder('utf-8').decode(value); text.trim().split('\n').forEach(function(v) { + result = '' if(v.length>6) result = v.slice(6); if(result == "[DONE]") { @@ -2080,6 +2084,7 @@ fetch("https://search.kg/completions", optionsIntro) if (done) return; const textIntro = new TextDecoder('utf-8').decode(value); textIntro.trim().split('\n').forEach(function(v) { + result = '' if(v.length>6) result = v.slice(6); if(result == "[DONE]") { @@ -2100,6 +2105,7 @@ fetch("https://search.kg/completions", optionsIntro) if (done) return; const text = new TextDecoder('utf-8').decode(value); text.trim().split('\n').forEach(function(v) { + result='' if(v.length>6) result = v.slice(6); if(result == "[DONE]") { @@ -2128,6 +2134,7 @@ fetch("https://search.kg/completions", optionsIntro) if (done) return; const textPlusComment = new TextDecoder('utf-8').decode(value); textPlusComment.trim().split('\n').forEach(function(v) { + result = '' if(v.length>6) result = v.slice(6); if(result == "[DONE]") {