Add functions for handling query box

This commit is contained in:
aryan 2024-03-07 17:31:08 -07:00
parent 3457515630
commit fdbb1a60af

View file

@ -35,3 +35,20 @@ const ollama_chat_complete = async (model, messages) => {
const js = await res.json() const js = await res.json()
return js 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
}