diff options
author | elioat <{ID}+{username}@users.noreply.github.com> | 2025-01-03 12:14:24 -0500 |
---|---|---|
committer | elioat <{ID}+{username}@users.noreply.github.com> | 2025-01-03 12:14:24 -0500 |
commit | ad29add006f06121e3f9adb22bd81dd06b186e50 (patch) | |
tree | 41f81ef296ca01c2b72223b11056f338a7d7e0eb /html/matt-chat | |
parent | 2b301f72039f2f26aa379cd9cd39e259de63a456 (diff) | |
download | tour-ad29add006f06121e3f9adb22bd81dd06b186e50.tar.gz |
*
Diffstat (limited to 'html/matt-chat')
-rw-r--r-- | html/matt-chat/index.html | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/html/matt-chat/index.html b/html/matt-chat/index.html index 42d2020..d6f04b5 100644 --- a/html/matt-chat/index.html +++ b/html/matt-chat/index.html @@ -180,10 +180,11 @@ { value: "qwen2.5-coder:32b", label: "qwen2.5-coder:32b, super slow coding" }, ], contextWindowSize: 3, // Number of previous exchanges to remember - systemMessage: "You are a helpful assistant, but if you don't know something you'll let me know. Your name is Matt. You are a cat." // Set the mood and personality for the LLM's responses + systemMessage: "You are a helpful assistant, but if you don't know something you'll let me know. Your name is Matt." // Set the mood and personality for the LLM's responses }; let conversationHistory = []; + let isCatMode = false; // Flag to track cat mode function populateModelSelect() { const modelSelect = document.getElementById("model-select"); @@ -253,7 +254,18 @@ // Event listener to update the counter on input document.getElementById("user-input").addEventListener("input", updateCounter); + // Function to toggle cat mode + function toggleCatMode() { + isCatMode = !isCatMode; // Toggle the flag + if (isCatMode) { + config.systemMessage += " You are a cat."; // Append the phrase + } else { + config.systemMessage = config.systemMessage.replace(" You are a cat.", ""); // Remove the phrase + } + addMessage(`Cat mode is now ${isCatMode ? "enabled" : "disabled"}.`, "bot"); // Inform the user + } + // Function to handle sending the message async function sendMessage() { const userInput = document.getElementById("user-input"); const userMessage = userInput.value.trim(); @@ -282,6 +294,13 @@ return; } + if (userMessage.toLowerCase() === '/cat') { + toggleCatMode(); // Toggle cat mode + userInput.value = ""; // Clear input after command + updateCounter(); // Reset counters + return; + } + addMessage(userMessage, "user"); conversationHistory.push({ role: "user", content: userMessage }); // Add user message to history userInput.value = ""; @@ -438,6 +457,7 @@ const helpMessage = ` Available commands:\n /darkmode - Toggle dark mode + /cat - Toggle cat mode /clear - Clear the chat history /help - Show this message `; |