From 746432c6fff779a580ccd7de530a72c3b5593013 Mon Sep 17 00:00:00 2001 From: Eri Date: Fri, 18 Jul 2025 17:04:30 +0200 Subject: [PATCH] forgot to save before committing --- lydia.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lydia.js b/lydia.js index 3242a73..f4719e0 100644 --- a/lydia.js +++ b/lydia.js @@ -108,12 +108,10 @@ function updateStreamMessage(content) { let letterIndex = -1; for (let i = 0; i < content.length - 1; i++) { if (/[a-zA-Z]/.test(content[i])) { - // If it's capital I, split immediately if (content[i] === "I") { letterIndex = i; break; } - // If next character is also a letter, split at two consecutive letters if (/[a-zA-Z]/.test(content[i + 1])) { letterIndex = i; break; @@ -173,7 +171,6 @@ function finalizeStreamMessage() { addMessage(assistantname, currentStreamMessage); } - // Add assistant message to conversation history conversationHistory.push({ role: "assistant", content: assistantMessage, @@ -200,7 +197,6 @@ async function sendMessage(message) { addMessage(username, message); - // Add user message to conversation history conversationHistory.push({ role: "user", content: message, @@ -239,7 +235,7 @@ inputBox.on("submit", async (text) => { inputBox.clearValue(); inputBox.focus(); - // Handle commands + // command trash if (text.trim().startsWith("l!")) { const commandParts = text.trim().slice(2).split(" "); const command = commandParts[0]; @@ -270,7 +266,7 @@ inputBox.on("submit", async (text) => { break; } } else { - // Regular message - send to ollama + // message just send it await sendMessage(text); } }