mirror of
https://github.com/searxng/searxng
synced 2024-01-01 19:24:07 +01:00
c
This commit is contained in:
parent
e2aedbe68d
commit
4892392d72
2 changed files with 28 additions and 28 deletions
|
@ -1377,9 +1377,9 @@ function modal_open(url, num)
|
||||||
try{choices=JSON.parse(half+result)['choices'];half = '';}
|
try{choices=JSON.parse(half+result)['choices'];half = '';}
|
||||||
catch(e){choices=JSON.parse(result)['choices'];half = '';}
|
catch(e){choices=JSON.parse(result)['choices'];half = '';}
|
||||||
}catch(e){half+=result}
|
}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")
|
chatTemp=chatTemp.replaceAll("\n\n","\n").replaceAll("\n\n","\n")
|
||||||
document.querySelector("#prompt").innerHTML="";
|
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 = '';}
|
try{choices=JSON.parse(half+result)['choices'];half = '';}
|
||||||
catch(e){choices=JSON.parse(result)['choices'];half = '';}
|
catch(e){choices=JSON.parse(result)['choices'];half = '';}
|
||||||
}catch(e){half+=result}
|
}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")
|
chatTemp=chatTemp.replaceAll("\n\n","\n").replaceAll("\n\n","\n")
|
||||||
document.querySelector("#prompt").innerHTML="";
|
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 = '';}
|
try{choices=JSON.parse(half+result)['choices'];half = '';}
|
||||||
catch(e){choices=JSON.parse(result)['choices'];half = '';}
|
catch(e){choices=JSON.parse(result)['choices'];half = '';}
|
||||||
}catch(e){half+=result}
|
}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")
|
chatTemp=chatTemp.replaceAll("\n\n","\n").replaceAll("\n\n","\n")
|
||||||
document.querySelector("#prompt").innerHTML="";
|
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 = '';}
|
try{choices=JSON.parse(half+result)['choices'];half = '';}
|
||||||
catch(e){choices=JSON.parse(result)['choices'];half = '';}
|
catch(e){choices=JSON.parse(result)['choices'];half = '';}
|
||||||
}catch(e){half+=result}
|
}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")
|
chatTemp=chatTemp.replaceAll("\n\n","\n").replaceAll("\n\n","\n")
|
||||||
document.querySelector("#prompt").innerHTML="";
|
document.querySelector("#prompt").innerHTML="";
|
||||||
|
@ -2143,9 +2143,9 @@ fetch("https://search.kg/completions", optionsIntro)
|
||||||
try{choices=JSON.parse(half+result)['choices'];half = '';}
|
try{choices=JSON.parse(half+result)['choices'];half = '';}
|
||||||
catch(e){choices=JSON.parse(result)['choices'];half = '';}
|
catch(e){choices=JSON.parse(result)['choices'];half = '';}
|
||||||
}catch(e){half+=result}
|
}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'));
|
markdownToHtml(beautify(chatTextRawPlusComment), document.getElementById('chat'));
|
||||||
|
@ -2166,9 +2166,9 @@ fetch("https://search.kg/completions", optionsIntro)
|
||||||
try{choices=JSON.parse(half+result)['choices'];half = '';}
|
try{choices=JSON.parse(half+result)['choices'];half = '';}
|
||||||
catch(e){choices=JSON.parse(result)['choices'];half = '';}
|
catch(e){choices=JSON.parse(result)['choices'];half = '';}
|
||||||
}catch(e){half+=result}
|
}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'));
|
markdownToHtml(beautify(chatTextRaw), document.getElementById('chat'));
|
||||||
|
|
||||||
|
@ -2199,9 +2199,9 @@ fetch("https://search.kg/completions", optionsIntro)
|
||||||
try{choices=JSON.parse(half+result)['choices'];half = '';}
|
try{choices=JSON.parse(half+result)['choices'];half = '';}
|
||||||
catch(e){choices=JSON.parse(result)['choices'];half = '';}
|
catch(e){choices=JSON.parse(result)['choices'];half = '';}
|
||||||
}catch(e){half+=result}
|
}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'));
|
markdownToHtml(beautify(chatTextRawIntro+'\n'), document.getElementById('chat_intro'));
|
||||||
|
|
||||||
|
|
|
@ -1377,9 +1377,9 @@ function modal_open(url, num)
|
||||||
try{choices=JSON.parse(half+result)['choices'];half = '';}
|
try{choices=JSON.parse(half+result)['choices'];half = '';}
|
||||||
catch(e){choices=JSON.parse(result)['choices'];half = '';}
|
catch(e){choices=JSON.parse(result)['choices'];half = '';}
|
||||||
}catch(e){half+=result}
|
}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")
|
chatTemp=chatTemp.replaceAll("\n\n","\n").replaceAll("\n\n","\n")
|
||||||
document.querySelector("#prompt").innerHTML="";
|
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 = '';}
|
try{choices=JSON.parse(half+result)['choices'];half = '';}
|
||||||
catch(e){choices=JSON.parse(result)['choices'];half = '';}
|
catch(e){choices=JSON.parse(result)['choices'];half = '';}
|
||||||
}catch(e){half+=result}
|
}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")
|
chatTemp=chatTemp.replaceAll("\n\n","\n").replaceAll("\n\n","\n")
|
||||||
document.querySelector("#prompt").innerHTML="";
|
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 = '';}
|
try{choices=JSON.parse(half+result)['choices'];half = '';}
|
||||||
catch(e){choices=JSON.parse(result)['choices'];half = '';}
|
catch(e){choices=JSON.parse(result)['choices'];half = '';}
|
||||||
}catch(e){half+=result}
|
}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")
|
chatTemp=chatTemp.replaceAll("\n\n","\n").replaceAll("\n\n","\n")
|
||||||
document.querySelector("#prompt").innerHTML="";
|
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 = '';}
|
try{choices=JSON.parse(half+result)['choices'];half = '';}
|
||||||
catch(e){choices=JSON.parse(result)['choices'];half = '';}
|
catch(e){choices=JSON.parse(result)['choices'];half = '';}
|
||||||
}catch(e){half+=result}
|
}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")
|
chatTemp=chatTemp.replaceAll("\n\n","\n").replaceAll("\n\n","\n")
|
||||||
document.querySelector("#prompt").innerHTML="";
|
document.querySelector("#prompt").innerHTML="";
|
||||||
|
@ -2143,9 +2143,9 @@ fetch("https://search.kg/completions", optionsIntro)
|
||||||
try{choices=JSON.parse(half+result)['choices'];half = '';}
|
try{choices=JSON.parse(half+result)['choices'];half = '';}
|
||||||
catch(e){choices=JSON.parse(result)['choices'];half = '';}
|
catch(e){choices=JSON.parse(result)['choices'];half = '';}
|
||||||
}catch(e){half+=result}
|
}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'));
|
markdownToHtml(beautify(chatTextRawPlusComment), document.getElementById('chat'));
|
||||||
|
@ -2166,9 +2166,9 @@ fetch("https://search.kg/completions", optionsIntro)
|
||||||
try{choices=JSON.parse(half+result)['choices'];half = '';}
|
try{choices=JSON.parse(half+result)['choices'];half = '';}
|
||||||
catch(e){choices=JSON.parse(result)['choices'];half = '';}
|
catch(e){choices=JSON.parse(result)['choices'];half = '';}
|
||||||
}catch(e){half+=result}
|
}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'));
|
markdownToHtml(beautify(chatTextRaw), document.getElementById('chat'));
|
||||||
|
|
||||||
|
@ -2199,9 +2199,9 @@ fetch("https://search.kg/completions", optionsIntro)
|
||||||
try{choices=JSON.parse(half+result)['choices'];half = '';}
|
try{choices=JSON.parse(half+result)['choices'];half = '';}
|
||||||
catch(e){choices=JSON.parse(result)['choices'];half = '';}
|
catch(e){choices=JSON.parse(result)['choices'];half = '';}
|
||||||
}catch(e){half+=result}
|
}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'));
|
markdownToHtml(beautify(chatTextRawIntro+'\n'), document.getElementById('chat_intro'));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue