This commit is contained in:
Joseph Cheung 2023-03-02 15:35:42 +08:00
parent f800a229dd
commit 362f0d177f
2 changed files with 4 additions and 2 deletions

View file

@ -2045,7 +2045,7 @@ function chatmore()
method: "POST", method: "POST",
headers: headers, headers: headers,
body: b64EncodeUnicode( JSON.stringify({ body: b64EncodeUnicode( JSON.stringify({
"messages": [{'role':'assistant','content': document.querySelector("#chat").innerHTML.replace(/<a.*?>.*?<\/a.*?>/g, '').replace(/<hr.*/gs, '').replace(/<[^>]+>/g,"").replace(/\n\n/g,"\n") +"\n" + '以上是“'+ original_search_query + '”的网络知识'}, {'role':'user','content':'给出需要更多网络知识才能回答的,不含代词的完整独立问题,json数组格式["q1","q2","q3","q4"]'}] , "messages": [{'role':'assistant','content': document.querySelector("#chat").innerHTML.replace(/<a.*?>.*?<\/a.*?>/g, '').replace(/<hr.*/gs, '').replace(/<[^>]+>/g,"").replace(/\n\n/g,"\n") +"\n" + '以上是“'+ original_search_query + '”的网络知识'}, {'role':'user','content':'给出需要更多网络知识才能回答的,不含代词的完整独立问题,不带序号的json数组格式["q1","q2","q3","q4"]'}] ,
"max_tokens": 1500, "max_tokens": 1500,
"temperature": 0.7, "temperature": 0.7,
"top_p": 1, "top_p": 1,
@ -2059,6 +2059,7 @@ function chatmore()
.then(response => response.json()) .then(response => response.json())
.then(data => { .then(data => {
JSON.parse(data.choices[0].message.content.replaceAll("\n","")).forEach(item => { JSON.parse(data.choices[0].message.content.replaceAll("\n","")).forEach(item => {
if(String(item).length>5)
document.querySelector("#chat_more").innerHTML += '<button class="btn_more" onclick="send_webchat(this)">'+ String(item) +'</button>' document.querySelector("#chat_more").innerHTML += '<button class="btn_more" onclick="send_webchat(this)">'+ String(item) +'</button>'
}); });
}) })

View file

@ -2045,7 +2045,7 @@ function chatmore()
method: "POST", method: "POST",
headers: headers, headers: headers,
body: b64EncodeUnicode( JSON.stringify({ body: b64EncodeUnicode( JSON.stringify({
"messages": [{'role':'assistant','content': document.querySelector("#chat").innerHTML.replace(/<a.*?>.*?<\/a.*?>/g, '').replace(/<hr.*/gs, '').replace(/<[^>]+>/g,"").replace(/\n\n/g,"\n") +"\n" + '以上是“'+ original_search_query + '”的网络知识'}, {'role':'user','content':'给出需要更多网络知识才能回答的,不含代词的完整独立问题,json数组格式["q1","q2","q3","q4"]'}] , "messages": [{'role':'assistant','content': document.querySelector("#chat").innerHTML.replace(/<a.*?>.*?<\/a.*?>/g, '').replace(/<hr.*/gs, '').replace(/<[^>]+>/g,"").replace(/\n\n/g,"\n") +"\n" + '以上是“'+ original_search_query + '”的网络知识'}, {'role':'user','content':'给出需要更多网络知识才能回答的,不含代词的完整独立问题,不带序号的json数组格式["q1","q2","q3","q4"]'}] ,
"max_tokens": 1500, "max_tokens": 1500,
"temperature": 0.7, "temperature": 0.7,
"top_p": 1, "top_p": 1,
@ -2059,6 +2059,7 @@ function chatmore()
.then(response => response.json()) .then(response => response.json())
.then(data => { .then(data => {
JSON.parse(data.choices[0].message.content.replaceAll("\n","")).forEach(item => { JSON.parse(data.choices[0].message.content.replaceAll("\n","")).forEach(item => {
if(String(item).length>5)
document.querySelector("#chat_more").innerHTML += '<button class="btn_more" onclick="send_webchat(this)">'+ String(item) +'</button>' document.querySelector("#chat_more").innerHTML += '<button class="btn_more" onclick="send_webchat(this)">'+ String(item) +'</button>'
}); });
}) })