Compare commits
2 commits
954688197a
...
fdbb1a60af
Author | SHA1 | Date | |
---|---|---|---|
aryan | fdbb1a60af | ||
aryan | 3457515630 |
|
@ -27,7 +27,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="w-full sticky top-100vh">
|
<div class="w-full sticky top-100vh">
|
||||||
<form class="bg-white shadow-md rounded px-8 pt-6 pb-8 mb-4">
|
<form id="chat-form" class="bg-white shadow-md rounded px-8 pt-6 pb-8 mb-4">
|
||||||
<div class="mb-4">
|
<div class="mb-4">
|
||||||
<input class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" id="username" type="text" placeholder="Query...">
|
<input class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" id="username" type="text" placeholder="Query...">
|
||||||
</div>
|
</div>
|
||||||
|
|
17
src/main.js
17
src/main.js
|
@ -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
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue