From a12c11c0586bab74882f8c4fcc5165a206b4d191 Mon Sep 17 00:00:00 2001 From: Joakim Persson Date: Tue, 30 Jul 2024 23:46:37 +0200 Subject: [PATCH] =?UTF-8?q?Arbetar=20med=20att=20g=C3=B6ra=20externt=20ska?= =?UTF-8?q?pade=20variabler=20tillg=C3=A4ngliga.=20Safari=20kr=C3=A4vre=20?= =?UTF-8?q?annnan=20hantering=20=C3=A4n=20=C3=B6vriga=20webl=C3=A4sare?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- smartassist/src/static/js/frontend.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/smartassist/src/static/js/frontend.js b/smartassist/src/static/js/frontend.js index 54f0453..a3ecdc0 100644 --- a/smartassist/src/static/js/frontend.js +++ b/smartassist/src/static/js/frontend.js @@ -10,11 +10,8 @@ const parser = window.markdownit({ parser.enable(['table']); - -// const html = markdownIt.use({ -// // You can customize the parser options here, e.g., enable/disable certain features -// }); - +console.log("frontend.js - API Endpoint: ", apiEndpoint); +console.log("frontend.js - use model: ", useModel); // Define a function to send the user's message to the AI function sendMessage() { @@ -24,10 +21,11 @@ function sendMessage() { // Check if the message is not empty if (query !== '') { - fetch(`${apiEndpoint}`, { + // fetch(`${apiEndpoint}`, { + fetch(apiEndpoint, { method: 'POST', headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ query, model: `${useModel}` }), // Add these parameters here + body: JSON.stringify({ query, model: useModel }), // Add these parameters here // body: JSON.stringify({ query, url_server: "http://your-custom-url", model: "phi3:mini" }), // Add these parameters here }) .then(response => response.json())