mirror of
https://github.com/searxng/searxng
synced 2024-01-01 19:24:07 +01:00
Update webapp.py
This commit is contained in:
parent
d2be38fd5f
commit
e753999663
1 changed files with 99 additions and 99 deletions
|
@ -743,12 +743,12 @@ def search():
|
||||||
number_of_results = 0
|
number_of_results = 0
|
||||||
|
|
||||||
# OPENAI GPT
|
# OPENAI GPT
|
||||||
if number_of_results != 0:
|
|
||||||
url_pair = {}
|
url_pair = {}
|
||||||
prompt = ""
|
prompt = ""
|
||||||
for res in results:
|
for res in results:
|
||||||
if 'url' not in res: continue
|
if 'url' not in res: continue
|
||||||
if 'content' not in res: continue
|
if 'content' not in res: continue
|
||||||
|
if 'title' not in res: continue
|
||||||
if res['content'] == '': continue
|
if res['content'] == '': continue
|
||||||
new_url = 'https://url'+str(len(url_pair)+1)
|
new_url = 'https://url'+str(len(url_pair)+1)
|
||||||
url_pair[new_url] = res['url']
|
url_pair[new_url] = res['url']
|
||||||
|
@ -770,7 +770,7 @@ def search():
|
||||||
}
|
}
|
||||||
if original_search_query != search_query.query:
|
if original_search_query != search_query.query:
|
||||||
gpt_data = {
|
gpt_data = {
|
||||||
"prompt": prompt+"\n以上是问题 " + original_search_query + " 的搜索结果,用简体中文分条总结问题的答案,在文中用markdown脚注指对应内容来源链接:",
|
"prompt": prompt+"\n以上是问题 " + original_search_query + " 的搜索结果,用简体中文分条总结简报,在文中用markdown脚注指对应内容来源链接:",
|
||||||
"max_tokens": 1000,
|
"max_tokens": 1000,
|
||||||
"temperature": 0.7,
|
"temperature": 0.7,
|
||||||
"top_p": 1,
|
"top_p": 1,
|
||||||
|
|
Loading…
Add table
Reference in a new issue