From 1101fd1c59bc6186cc4747a240ed118507004af5 Mon Sep 17 00:00:00 2001 From: Joseph Cheung Date: Mon, 20 Feb 2023 19:06:13 +0800 Subject: [PATCH] Update webapp.py --- searx/webapp.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/searx/webapp.py b/searx/webapp.py index d6ce22221..dee9addd1 100755 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -719,7 +719,10 @@ def search(): gpt_json = gpt_response.json() if 'choices' in gpt_json: gpt = gpt_json['choices'][0]['text'] - gpt = gpt.replace("\n","").replace("\"","").replace("\'","") + for word in gpt.split('\n'): + if word != "": + gpt = word + break if gpt!="": search_query.query = gpt search = SearchWithPlugins(search_query, request.user_plugins, request) # pylint: disable=redefined-outer-name