diff --git a/searx/webapp.py b/searx/webapp.py index b572817e3..bb430d897 100755 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -744,6 +744,7 @@ def search(): number_of_results = 0 # OPENAI GPT + raws = [] try: url_pair = [] prompt = "" @@ -770,6 +771,7 @@ def search(): tmp_prompt = res['title'] +'\n'+ res['content'] + '\n' + new_url +'\n' if original_search_query == search_query.query and len( prompt + tmp_prompt +'\n' + "\n以上是关键词 " + original_search_query + " 的搜索结果,删除无关内容,用简体中文分条总结简报,在文中用(链接)标注对应内容来源链接,链接不要放在最后。结果:" ) <2000: + raws.append(tmp_prompt) prompt += tmp_prompt +'\n' if len( prompt + tmp_prompt +'\n' + "\n以上是任务 " + original_search_query + " 的网络知识。用简体中文完成任务,如果使用了网络知识,删除无关内容,在文中用(链接)标注对应内容来源链接,链接不要放在最后。结果:") <2000: prompt += tmp_prompt +'\n' @@ -805,7 +807,7 @@ def search(): "logprobs": 0, "stream": True } - gpt = json.dumps({'data':gpt_data, 'url_pair':url_pair}) + gpt = json.dumps({'data':gpt_data, 'url_pair':url_pair, 'raws': raws}) gpt = '
' + r'''