Update webapp.py

This commit is contained in:
Joseph Cheung 2023-02-20 19:06:13 +08:00
parent 08e9ea694b
commit 1101fd1c59

View file

@ -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