diff --git a/searx/webapp.py b/searx/webapp.py index 18e2556eb..e0893341d 100755 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -833,10 +833,10 @@ def search(): tmp_prompt = res['title'] +'\n'+ res['content'] + '\n' + new_url +'\n' - if '搜索' in search_type and len( prompt + tmp_prompt +'\n' + "\n以上是关键词 " + original_search_query + " 的搜索结果,删除无关内容,用简体中文分条总结简报,在文中用(网址)标注对应内容来源链接。结果:" ) <1600: + if '搜索' in search_type and len( prompt + tmp_prompt +'\n' + "\n以上是关键词 " + original_search_query + " 的搜索结果,用简体中文总结简报,在文中用(网址)标注对应内容来源链接。结果:" ) <1600: raws.append(tmp_prompt) prompt += tmp_prompt +'\n' - elif len( prompt + tmp_prompt +'\n' + "\n以上是 " + original_search_query + " 的网络知识。用简体中文完成"+ search_type +",如果使用了网络知识,删除无关内容,在文中用(网址)标注对应内容来源链接。结果:") <1600: + elif len( prompt + tmp_prompt +'\n' + "\n以上是 " + original_search_query + " 的网络知识。用简体中文完成"+ search_type +",如果使用了网络知识,在文中用(网址)标注对应内容来源链接。结果:") <1600: prompt += tmp_prompt +'\n' if prompt != "": gpt = "" @@ -846,7 +846,7 @@ def search(): } if '搜索' not in search_type: gpt_data = { - "messages": [{'role':'assistant','content': prompt+"\n以上是 " + original_search_query + " 的网络知识"},{'role':'user','content':"用简体中文完成"+ search_type +",如果使用了网络知识,删除无关内容,在文中用(网址)标注对应内容来源链接"}] , + "messages": [{'role':'assistant','content': prompt+"\n以上是 " + original_search_query + " 的网络知识"},{'role':'user','content':"用简体中文完成"+ search_type +",如果使用了网络知识,在文中用(网址)标注对应内容来源链接"}] , "max_tokens": 1000, "temperature": 0.2, "top_p": 1, @@ -856,7 +856,7 @@ def search(): } else: gpt_data = { - "messages": [{'role':'assistant','content': prompt+"\n以上是 " + original_search_query + " 的搜索结果"},{'role':'user','content':"用简体中文完成"+ search_type +",删除无关内容,用简体中文分条总结简报,在文中用(网址)标注对应内容来源链接"}] , + "messages": [{'role':'assistant','content': prompt+"\n以上是 " + original_search_query + " 的搜索结果"},{'role':'user','content':"用简体中文完成"+ search_type +",用简体中文总结简报,在文中用(网址)标注对应内容来源链接"}] , "max_tokens": 1000, "temperature": 0.2, "top_p": 1, diff --git a/searx/webapp1.py b/searx/webapp1.py index 18e2556eb..e0893341d 100644 --- a/searx/webapp1.py +++ b/searx/webapp1.py @@ -833,10 +833,10 @@ def search(): tmp_prompt = res['title'] +'\n'+ res['content'] + '\n' + new_url +'\n' - if '搜索' in search_type and len( prompt + tmp_prompt +'\n' + "\n以上是关键词 " + original_search_query + " 的搜索结果,删除无关内容,用简体中文分条总结简报,在文中用(网址)标注对应内容来源链接。结果:" ) <1600: + if '搜索' in search_type and len( prompt + tmp_prompt +'\n' + "\n以上是关键词 " + original_search_query + " 的搜索结果,用简体中文总结简报,在文中用(网址)标注对应内容来源链接。结果:" ) <1600: raws.append(tmp_prompt) prompt += tmp_prompt +'\n' - elif len( prompt + tmp_prompt +'\n' + "\n以上是 " + original_search_query + " 的网络知识。用简体中文完成"+ search_type +",如果使用了网络知识,删除无关内容,在文中用(网址)标注对应内容来源链接。结果:") <1600: + elif len( prompt + tmp_prompt +'\n' + "\n以上是 " + original_search_query + " 的网络知识。用简体中文完成"+ search_type +",如果使用了网络知识,在文中用(网址)标注对应内容来源链接。结果:") <1600: prompt += tmp_prompt +'\n' if prompt != "": gpt = "" @@ -846,7 +846,7 @@ def search(): } if '搜索' not in search_type: gpt_data = { - "messages": [{'role':'assistant','content': prompt+"\n以上是 " + original_search_query + " 的网络知识"},{'role':'user','content':"用简体中文完成"+ search_type +",如果使用了网络知识,删除无关内容,在文中用(网址)标注对应内容来源链接"}] , + "messages": [{'role':'assistant','content': prompt+"\n以上是 " + original_search_query + " 的网络知识"},{'role':'user','content':"用简体中文完成"+ search_type +",如果使用了网络知识,在文中用(网址)标注对应内容来源链接"}] , "max_tokens": 1000, "temperature": 0.2, "top_p": 1, @@ -856,7 +856,7 @@ def search(): } else: gpt_data = { - "messages": [{'role':'assistant','content': prompt+"\n以上是 " + original_search_query + " 的搜索结果"},{'role':'user','content':"用简体中文完成"+ search_type +",删除无关内容,用简体中文分条总结简报,在文中用(网址)标注对应内容来源链接"}] , + "messages": [{'role':'assistant','content': prompt+"\n以上是 " + original_search_query + " 的搜索结果"},{'role':'user','content':"用简体中文完成"+ search_type +",用简体中文总结简报,在文中用(网址)标注对应内容来源链接"}] , "max_tokens": 1000, "temperature": 0.2, "top_p": 1,