about summary refs log tree commit diff stats
path: root/html/matt-chat
diff options
context:
space:
mode:
authorelioat <elioat@tilde.institute>2025-01-06 17:08:40 -0500
committerelioat <elioat@tilde.institute>2025-01-06 17:08:40 -0500
commit2cf744b31688582aa093c06942b8f0dbb6c32ed5 (patch)
treef59fb198ad2898b95e41630c1bc79a98e012ceda /html/matt-chat
parent8d107ac58023981750de62d480385ab3549880e7 (diff)
downloadtour-2cf744b31688582aa093c06942b8f0dbb6c32ed5.tar.gz
*
Diffstat (limited to 'html/matt-chat')
-rw-r--r--html/matt-chat/index.html46
1 files changed, 41 insertions, 5 deletions
diff --git a/html/matt-chat/index.html b/html/matt-chat/index.html
index 8ccc9be..2bc8119 100644
--- a/html/matt-chat/index.html
+++ b/html/matt-chat/index.html
@@ -721,16 +721,29 @@
         // Set the base url for the ollama api, and then list all the models you want to use
         // The context window size is the number of previous exchanges to keep...
         // though this is relatively naive at the moment
-        const config = {
+
+        const config = {}
+
+        const localConfig = {
             apiUrl: "http://localhost:11434/v1",
             completionsEndpoint: "http://localhost:11434/v1/chat/completions",
             modelsEndpoint: "http://localhost:11434/v1/models",
-            contextWindowSize: 6, // Number of previous exchanges to remember
-            systemMessage: "You are a helpful assistant. 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
-            maxTokens: 4096, // Approximate max tokens for most models
-            summarizeThreshold: 3584, // When to trigger summarization
+            contextWindowSize: 6,
+            systemMessage: "You are a helpful assistant. If you don't know something you'll let me know. Your name is Matt.",
+            maxTokens: 4096,
+            summarizeThreshold: 3584,
         };
 
+        const mattConfig = {
+            apiUrl: "http://100.108.91.106:11434/v1",
+            completionsEndpoint: "http://100.108.91.106:11434/v1/chat/completions",
+            modelsEndpoint: "http://100.108.91.106:11434/v1/models",
+            contextWindowSize: 6,
+            systemMessage: "You are a helpful assistant. If you don't know something you'll let me know. Your name is Matt.",
+            maxTokens: 4096,
+            summarizeThreshold: 3584,
+        }
+
         let conversationHistory = {
             summary: null,
             current: [],
@@ -917,6 +930,24 @@
                 return;
             }
 
+            if (userMessage.toLowerCase() === '/matt') {
+                Object.assign(config, mattConfig);
+                addMessage("Switched to Matt's config", "bot");
+                userInput.value = "";
+                updateCounter();
+                populateModelSelect(); // Refresh the model list for the new endpoint
+                return;
+            }
+
+            if (userMessage.toLowerCase() === '/local') {
+                Object.assign(config, localConfig);
+                addMessage("Switched to local config", "bot");
+                userInput.value = "";
+                updateCounter();
+                populateModelSelect(); // Refresh the model list for the new endpoint
+                return;
+            }
+
             addMessage(userMessage, "user");
             userInput.value = ""; // Clear input after sending the message
             
@@ -1070,6 +1101,8 @@ Available commands:\n
   /help - Show this message
   /theme [theme-name] - Switch theme (available themes: ${Object.keys(AVAILABLE_THEMES).join(', ')})
       without a theme name, this will show all available themes, too
+  /local - Switch to local Ollama instance
+  /matt - Switch to Matt's Ollama instance
             `;
             addMessage(helpMessage, "bot");
         }
@@ -1225,6 +1258,9 @@ Available commands:\n
             localStorage.setItem('selectedTheme', themeName);            
             addMessage(`Theme switched to: ${AVAILABLE_THEMES[themeName]}`, "bot");
         }
+
+        // Initialize with localConfig
+        Object.assign(config, localConfig);
     </script>
 </body>
 </html>