From 610153d3e575452126855e85945134b288000891 Mon Sep 17 00:00:00 2001 From: Joseph Cheung Date: Tue, 21 Feb 2023 21:44:48 +0800 Subject: [PATCH] Update webapp.py --- searx/webapp.py | 48 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/searx/webapp.py b/searx/webapp.py index ceb56de01..e6dedec37 100755 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -799,7 +799,46 @@ def search(): "stream": True } gpt = json.dumps({'data':gpt_data, 'url_pair':url_pair}) - gpt = '
' '' + gpt = '
' '' # gpt_response = requests.post(gpt_url, headers=gpt_headers, data=json.dumps(gpt_data)) # gpt_json = gpt_response.json() # if 'choices' in gpt_json: @@ -906,7 +945,11 @@ let prompt = JSON.parse(document.querySelector("#prompt").textContent); const text = new TextDecoder('utf-8').decode(value); text.trim().split('\n').forEach(function(v) { if(v.length>6) result = v.slice(6); - if(result == "[DONE]") return; + if(result == "[DONE]") + { + document.getElementById('chat_continue').style.display=""; + return; + } const { choices } = JSON.parse(result); chatTextRaw+=choices[0].text @@ -919,6 +962,7 @@ let prompt = JSON.parse(document.querySelector("#prompt").textContent); .catch((error) => { console.error('Error:', error); }); + ''' # for i in range(1,16):