Initial implementation of the chat application with MariaDB and ArangoDB integration, including Docker setup and web interface.
This commit is contained in:
12
web/scripts.js
Normal file
12
web/scripts.js
Normal file
@@ -0,0 +1,12 @@
|
||||
async function sendMessage() {
|
||||
const project = document.getElementById('project').value;
|
||||
const message = document.getElementById('message').value;
|
||||
const res = await fetch('http://localhost:5000/chat', {
|
||||
method: 'POST',
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
body: JSON.stringify({project, message})
|
||||
});
|
||||
const data = await res.json();
|
||||
const messagesDiv = document.getElementById('messages');
|
||||
messagesDiv.innerHTML += `<p><b>Du:</b> ${message}</p><p><b>LLM:</b> ${data.reply}</p>`;
|
||||
}
|
||||
Reference in New Issue
Block a user