This commit is contained in:
Joseph Cheung 2023-03-02 13:52:45 +08:00
parent a5884843b2
commit 4592ed1d94

View file

@ -833,10 +833,10 @@ def search():
tmp_prompt = res['title'] +'\n'+ res['content'] + '\n' + new_url +'\n' 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) raws.append(tmp_prompt)
prompt += tmp_prompt +'\n' 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' prompt += tmp_prompt +'\n'
if prompt != "": if prompt != "":
gpt = "" gpt = ""
@ -846,7 +846,7 @@ def search():
} }
if '搜索' not in search_type: if '搜索' not in search_type:
gpt_data = { 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, "max_tokens": 1000,
"temperature": 0.2, "temperature": 0.2,
"top_p": 1, "top_p": 1,
@ -856,7 +856,7 @@ def search():
} }
else: else:
gpt_data = { 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, "max_tokens": 1000,
"temperature": 0.2, "temperature": 0.2,
"top_p": 1, "top_p": 1,