This commit is contained in:
Joseph Cheung 2023-03-02 13:00:41 +08:00
parent e2aedbe68d
commit 4892392d72
2 changed files with 28 additions and 28 deletions

View file

@ -1377,9 +1377,9 @@ function modal_open(url, num)
try{choices=JSON.parse(half+result)['choices'];half = '';}
catch(e){choices=JSON.parse(result)['choices'];half = '';}
}catch(e){half+=result}
if(choices && choices.length>0 && choices[0].content)
if(choices && choices.length>0 && choices[0].delta.content)
{
chatTemp+=choices[0].content
chatTemp+=choices[0].delta.content
}
chatTemp=chatTemp.replaceAll("\n\n","\n").replaceAll("\n\n","\n")
document.querySelector("#prompt").innerHTML="";
@ -1713,10 +1713,10 @@ prev_chat = prev_chat+'<div class="chat_question">'+document.querySelector("#pro
try{choices=JSON.parse(half+result)['choices'];half = '';}
catch(e){choices=JSON.parse(result)['choices'];half = '';}
}catch(e){half+=result}
if(choices && choices.length>0 && choices[0].content)
if(choices && choices.length>0 && choices[0].delta.content)
{
chatTemp+=choices[0].content
chatTemp+=choices[0].delta.content
}
chatTemp=chatTemp.replaceAll("\n\n","\n").replaceAll("\n\n","\n")
document.querySelector("#prompt").innerHTML="";
@ -1834,10 +1834,10 @@ prev_chat = prev_chat+'<div class="chat_question">'+document.querySelector("#pro
try{choices=JSON.parse(half+result)['choices'];half = '';}
catch(e){choices=JSON.parse(result)['choices'];half = '';}
}catch(e){half+=result}
if(choices && choices.length>0 && choices[0].content)
if(choices && choices.length>0 && choices[0].delta.content)
{
chatTemp+=choices[0].content
chatTemp+=choices[0].delta.content
}
chatTemp=chatTemp.replaceAll("\n\n","\n").replaceAll("\n\n","\n")
document.querySelector("#prompt").innerHTML="";
@ -1922,10 +1922,10 @@ prev_chat = prev_chat+'<div class="chat_question">'+document.querySelector("#pro
try{choices=JSON.parse(half+result)['choices'];half = '';}
catch(e){choices=JSON.parse(result)['choices'];half = '';}
}catch(e){half+=result}
if(choices && choices.length>0 && choices[0].content)
if(choices && choices.length>0 && choices[0].delta.content)
{
chatTemp+=choices[0].content
chatTemp+=choices[0].delta.content
}
chatTemp=chatTemp.replaceAll("\n\n","\n").replaceAll("\n\n","\n")
document.querySelector("#prompt").innerHTML="";
@ -2143,9 +2143,9 @@ fetch("https://search.kg/completions", optionsIntro)
try{choices=JSON.parse(half+result)['choices'];half = '';}
catch(e){choices=JSON.parse(result)['choices'];half = '';}
}catch(e){half+=result}
if(choices && choices.length>0 && choices[0].content)
if(choices && choices.length>0 && choices[0].delta.content)
{
chatTextRawPlusComment+=choices[0].content
chatTextRawPlusComment+=choices[0].delta.content
}
markdownToHtml(beautify(chatTextRawPlusComment), document.getElementById('chat'));
@ -2166,9 +2166,9 @@ fetch("https://search.kg/completions", optionsIntro)
try{choices=JSON.parse(half+result)['choices'];half = '';}
catch(e){choices=JSON.parse(result)['choices'];half = '';}
}catch(e){half+=result}
if(choices && choices.length>0 && choices[0].content)
if(choices && choices.length>0 && choices[0].delta.content)
{
chatTextRaw+=choices[0].content
chatTextRaw+=choices[0].delta.content
}
markdownToHtml(beautify(chatTextRaw), document.getElementById('chat'));
@ -2199,9 +2199,9 @@ fetch("https://search.kg/completions", optionsIntro)
try{choices=JSON.parse(half+result)['choices'];half = '';}
catch(e){choices=JSON.parse(result)['choices'];half = '';}
}catch(e){half+=result}
if(choices && choices.length>0 && choices[0].content)
if(choices && choices.length>0 && choices[0].delta.content)
{
chatTextRawIntro+=choices[0].content
chatTextRawIntro+=choices[0].delta.content
}
markdownToHtml(beautify(chatTextRawIntro+'\n'), document.getElementById('chat_intro'));

View file

@ -1377,9 +1377,9 @@ function modal_open(url, num)
try{choices=JSON.parse(half+result)['choices'];half = '';}
catch(e){choices=JSON.parse(result)['choices'];half = '';}
}catch(e){half+=result}
if(choices && choices.length>0 && choices[0].content)
if(choices && choices.length>0 && choices[0].delta.content)
{
chatTemp+=choices[0].content
chatTemp+=choices[0].delta.content
}
chatTemp=chatTemp.replaceAll("\n\n","\n").replaceAll("\n\n","\n")
document.querySelector("#prompt").innerHTML="";
@ -1713,10 +1713,10 @@ prev_chat = prev_chat+'<div class="chat_question">'+document.querySelector("#pro
try{choices=JSON.parse(half+result)['choices'];half = '';}
catch(e){choices=JSON.parse(result)['choices'];half = '';}
}catch(e){half+=result}
if(choices && choices.length>0 && choices[0].content)
if(choices && choices.length>0 && choices[0].delta.content)
{
chatTemp+=choices[0].content
chatTemp+=choices[0].delta.content
}
chatTemp=chatTemp.replaceAll("\n\n","\n").replaceAll("\n\n","\n")
document.querySelector("#prompt").innerHTML="";
@ -1834,10 +1834,10 @@ prev_chat = prev_chat+'<div class="chat_question">'+document.querySelector("#pro
try{choices=JSON.parse(half+result)['choices'];half = '';}
catch(e){choices=JSON.parse(result)['choices'];half = '';}
}catch(e){half+=result}
if(choices && choices.length>0 && choices[0].content)
if(choices && choices.length>0 && choices[0].delta.content)
{
chatTemp+=choices[0].content
chatTemp+=choices[0].delta.content
}
chatTemp=chatTemp.replaceAll("\n\n","\n").replaceAll("\n\n","\n")
document.querySelector("#prompt").innerHTML="";
@ -1922,10 +1922,10 @@ prev_chat = prev_chat+'<div class="chat_question">'+document.querySelector("#pro
try{choices=JSON.parse(half+result)['choices'];half = '';}
catch(e){choices=JSON.parse(result)['choices'];half = '';}
}catch(e){half+=result}
if(choices && choices.length>0 && choices[0].content)
if(choices && choices.length>0 && choices[0].delta.content)
{
chatTemp+=choices[0].content
chatTemp+=choices[0].delta.content
}
chatTemp=chatTemp.replaceAll("\n\n","\n").replaceAll("\n\n","\n")
document.querySelector("#prompt").innerHTML="";
@ -2143,9 +2143,9 @@ fetch("https://search.kg/completions", optionsIntro)
try{choices=JSON.parse(half+result)['choices'];half = '';}
catch(e){choices=JSON.parse(result)['choices'];half = '';}
}catch(e){half+=result}
if(choices && choices.length>0 && choices[0].content)
if(choices && choices.length>0 && choices[0].delta.content)
{
chatTextRawPlusComment+=choices[0].content
chatTextRawPlusComment+=choices[0].delta.content
}
markdownToHtml(beautify(chatTextRawPlusComment), document.getElementById('chat'));
@ -2166,9 +2166,9 @@ fetch("https://search.kg/completions", optionsIntro)
try{choices=JSON.parse(half+result)['choices'];half = '';}
catch(e){choices=JSON.parse(result)['choices'];half = '';}
}catch(e){half+=result}
if(choices && choices.length>0 && choices[0].content)
if(choices && choices.length>0 && choices[0].delta.content)
{
chatTextRaw+=choices[0].content
chatTextRaw+=choices[0].delta.content
}
markdownToHtml(beautify(chatTextRaw), document.getElementById('chat'));
@ -2199,9 +2199,9 @@ fetch("https://search.kg/completions", optionsIntro)
try{choices=JSON.parse(half+result)['choices'];half = '';}
catch(e){choices=JSON.parse(result)['choices'];half = '';}
}catch(e){half+=result}
if(choices && choices.length>0 && choices[0].content)
if(choices && choices.length>0 && choices[0].delta.content)
{
chatTextRawIntro+=choices[0].content
chatTextRawIntro+=choices[0].delta.content
}
markdownToHtml(beautify(chatTextRawIntro+'\n'), document.getElementById('chat_intro'));