remove ningle and create simple router

This commit is contained in:
Lukas Nöllemeyer 2025-02-04 13:16:32 +01:00
parent 0aac3aae10
commit 63d079340b
3 changed files with 47 additions and 7 deletions

View file

@ -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("");