From 34575156306eec6910ed59c06a471cc1d7d3f390 Mon Sep 17 00:00:00 2001 From: pyarya Date: Thu, 7 Mar 2024 17:28:55 -0700 Subject: [PATCH 1/2] class for js call --- src/main.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.html b/src/main.html index fb888c3..7e0fe0c 100644 --- a/src/main.html +++ b/src/main.html @@ -27,7 +27,7 @@
-
+
-- 2.43.4 From fdbb1a60af65004305937318fd7edd7f16bf3ee5 Mon Sep 17 00:00:00 2001 From: pyarya Date: Thu, 7 Mar 2024 17:31:08 -0700 Subject: [PATCH 2/2] Add functions for handling query box --- src/main.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/main.js b/src/main.js index 3bb5c60..f3e9318 100644 --- a/src/main.js +++ b/src/main.js @@ -35,3 +35,20 @@ const ollama_chat_complete = async (model, messages) => { const js = await res.json() return js } + +const form = document.getElementById('chat-form') + +form.addEventListener('submit', FormSubmit); + +function FormSubmit(event) { + // do we have to prevent default form submission behaviour? im not sure + const query = document.getElementById('username').value; + + FutureFunction(query); +} + +function FutureFunction(query) { + // we put everything that happens with the query here +} + + -- 2.43.4