remove ningle and create simple router
This commit is contained in:
parent
0aac3aae10
commit
63d079340b
3 changed files with 47 additions and 7 deletions
|
|
@ -31,7 +31,7 @@ function messageListener(elem, idx, type) {
|
|||
}
|
||||
|
||||
async function sendAbort() {
|
||||
fetch('/rkllm_abort', {
|
||||
fetch('/rkllm-abort', {
|
||||
method: 'POST',
|
||||
body: true
|
||||
}).catch(error => alert(error))
|
||||
|
|
@ -73,7 +73,7 @@ async function sendMessage() {
|
|||
|
||||
const withSysMsg = (sysText ? [{role: 'system', 'content': sysText}] : []).concat(messagesToSend);
|
||||
|
||||
const response = await fetch('/rkllm_chat', {
|
||||
const response = await fetch('/rkllm-chat', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
|
|
@ -98,7 +98,7 @@ async function sendMessage() {
|
|||
let chunks = '';
|
||||
function double_try() {
|
||||
function display(n) {
|
||||
const ccs = chunks.split(/\n/).filter(e => e !== "");
|
||||
const ccs = chunks.trim().split(/\n/).filter(e => e !== "");
|
||||
const json = JSON.parse(ccs[ccs.length - n]);
|
||||
const text = `${json.choices.map((c) => c.delta.content).join('')}`;
|
||||
while (cur_idx >= answers.length) answers.push("");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue