From 3f89aeb804f5ecc8f6b956e7af7daa0c1bc839c4 Mon Sep 17 00:00:00 2001 From: Joseph Cheung Date: Fri, 24 Feb 2023 22:42:40 +0800 Subject: [PATCH] Update webapp.py --- searx/webapp.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/searx/webapp.py b/searx/webapp.py index d1d28348c..8bddf37a0 100755 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -1070,8 +1070,8 @@ prev_chat = prev_chat+'
'+document.querySelector("#pro let choices; try { - try{choice=JSON.parse(half+result)['choices'];half = '';} - catch(e){choice=JSON.parse(result)['choices'];half = '';} + try{choices=JSON.parse(half+result)['choices'];half = '';} + catch(e){choices=JSON.parse(result)['choices'];half = '';} }catch(e){half+=result} if(choices && choices.length>0 && choices[0].logprobs.text_offset[0] > text_offset) { @@ -1160,8 +1160,8 @@ prev_chat = prev_chat+'
'+document.querySelector("#pro let choices; try { - try{choice=JSON.parse(half+result)['choices'];half = '';} - catch(e){choice=JSON.parse(result)['choices'];half = '';} + try{choices=JSON.parse(half+result)['choices'];half = '';} + catch(e){choices=JSON.parse(result)['choices'];half = '';} }catch(e){half+=result} if(choices && choices.length>0 && choices[0].logprobs.text_offset[0] > text_offset) { @@ -1379,8 +1379,8 @@ fetch("https://search.kg/completions", optionsIntro) let choices; try { - try{choice=JSON.parse(half+result)['choices'];half = '';} - catch(e){choice=JSON.parse(result)['choices'];half = '';} + try{choices=JSON.parse(half+result)['choices'];half = '';} + catch(e){choices=JSON.parse(result)['choices'];half = '';} }catch(e){half+=result} if(choices && choices.length>0 && choices[0].logprobs.text_offset[0] > text_offset) { @@ -1402,8 +1402,8 @@ fetch("https://search.kg/completions", optionsIntro) let choices; try { - try{choice=JSON.parse(half+result)['choices'];half = '';} - catch(e){choice=JSON.parse(result)['choices'];half = '';} + try{choices=JSON.parse(half+result)['choices'];half = '';} + catch(e){choices=JSON.parse(result)['choices'];half = '';} }catch(e){half+=result} if(choices && choices.length>0 && choices[0].logprobs.text_offset[0] > text_offset) { @@ -1435,8 +1435,8 @@ fetch("https://search.kg/completions", optionsIntro) let choices; try { - try{choice=JSON.parse(half+result)['choices'];half = '';} - catch(e){choice=JSON.parse(result)['choices'];half = '';} + try{choices=JSON.parse(half+result)['choices'];half = '';} + catch(e){choices=JSON.parse(result)['choices'];half = '';} }catch(e){half+=result} if(choices && choices.length>0 && choices[0].logprobs.text_offset[0] > text_offset) {