Arbetar med att göra externt skapade variabler tillgängliga. Safari krävre annnan hantering än övriga webläsare
This commit is contained in:
@@ -10,11 +10,8 @@ const parser = window.markdownit({
|
|||||||
|
|
||||||
parser.enable(['table']);
|
parser.enable(['table']);
|
||||||
|
|
||||||
|
console.log("frontend.js - API Endpoint: ", apiEndpoint);
|
||||||
// const html = markdownIt.use({
|
console.log("frontend.js - use model: ", useModel);
|
||||||
// // You can customize the parser options here, e.g., enable/disable certain features
|
|
||||||
// });
|
|
||||||
|
|
||||||
|
|
||||||
// Define a function to send the user's message to the AI
|
// Define a function to send the user's message to the AI
|
||||||
function sendMessage() {
|
function sendMessage() {
|
||||||
@@ -24,10 +21,11 @@ function sendMessage() {
|
|||||||
// Check if the message is not empty
|
// Check if the message is not empty
|
||||||
if (query !== '') {
|
if (query !== '') {
|
||||||
|
|
||||||
fetch(`${apiEndpoint}`, {
|
// fetch(`${apiEndpoint}`, {
|
||||||
|
fetch(apiEndpoint, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: { 'Content-Type': 'application/json' },
|
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
|
// body: JSON.stringify({ query, url_server: "http://your-custom-url", model: "phi3:mini" }), // Add these parameters here
|
||||||
})
|
})
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
|
|||||||
Reference in New Issue
Block a user