This commit is contained in:
Joseph Cheung 2023-02-27 18:11:00 +08:00
parent 396c67dc6c
commit 0b334c7cf8
2 changed files with 8 additions and 2 deletions

View file

@ -1100,6 +1100,7 @@ function send_webchat(elem)
document.querySelector("#prompt").innerHTML=""; document.querySelector("#prompt").innerHTML="";
markdownToHtml(beautify(word), document.querySelector("#prompt")) markdownToHtml(beautify(word), document.querySelector("#prompt"))
proxify()
chatTextRaw = "提问:" + word + "\n回答:"; chatTextRaw = "提问:" + word + "\n回答:";
chatTemp = "" chatTemp = ""
text_offset = -1; text_offset = -1;
@ -1321,7 +1322,8 @@ for(let i=prompt.url_pair.length;i>=0;--i)
function proxify() function proxify()
{ {
for(let i=prompt.url_proxy.length;i>=0;--i) for(let i=prompt.url_proxy.length;i>=0;--i)
document.querySelector("#fnref\\:"+String(i)).href = url_proxy[i]; document.querySelector("#fnref\\:"+String(i)).href = prompt.url_proxy[i]
} }
function chatmore() function chatmore()
@ -1487,6 +1489,7 @@ fetch("https://search.kg/completions", optionsIntro)
text_offset = choices[0].logprobs.text_offset[choices[0].logprobs.text_offset.length - 1] text_offset = choices[0].logprobs.text_offset[choices[0].logprobs.text_offset.length - 1]
} }
markdownToHtml(beautify(chatTextRaw), document.getElementById('chat')); markdownToHtml(beautify(chatTextRaw), document.getElementById('chat'));
proxify()
}) })
return reader.read().then(processText); return reader.read().then(processText);

View file

@ -1100,6 +1100,7 @@ function send_webchat(elem)
document.querySelector("#prompt").innerHTML=""; document.querySelector("#prompt").innerHTML="";
markdownToHtml(beautify(word), document.querySelector("#prompt")) markdownToHtml(beautify(word), document.querySelector("#prompt"))
proxify()
chatTextRaw = "提问:" + word + "\n回答:"; chatTextRaw = "提问:" + word + "\n回答:";
chatTemp = "" chatTemp = ""
text_offset = -1; text_offset = -1;
@ -1321,7 +1322,8 @@ for(let i=prompt.url_pair.length;i>=0;--i)
function proxify() function proxify()
{ {
for(let i=prompt.url_proxy.length;i>=0;--i) for(let i=prompt.url_proxy.length;i>=0;--i)
document.querySelector("#fnref\\:"+String(i)).href = url_proxy[i]; document.querySelector("#fnref\\:"+String(i)).href = prompt.url_proxy[i]
} }
function chatmore() function chatmore()
@ -1487,6 +1489,7 @@ fetch("https://search.kg/completions", optionsIntro)
text_offset = choices[0].logprobs.text_offset[choices[0].logprobs.text_offset.length - 1] text_offset = choices[0].logprobs.text_offset[choices[0].logprobs.text_offset.length - 1]
} }
markdownToHtml(beautify(chatTextRaw), document.getElementById('chat')); markdownToHtml(beautify(chatTextRaw), document.getElementById('chat'));
proxify()
}) })
return reader.read().then(processText); return reader.read().then(processText);