import axios from "axios"; onmessage = (e) => { const { messages = [{ role: "assistant", content: "Hello! How can I help you?" }], ai_model = "phi3.5", access_token } = e.data messages.unshift({ role: "system", content: "You are a Helpful assistant. you give short answers" }) const Message = { messages: messages, ai_model: "phi3.5", model_type: "local", access_token: access_token } console.log(Message); axios.post("http://localhost:5000/interstellar_ai/api/ai_send", Message) .then(response => { const status = response.data.status console.log(status); postMessage({ status }) console.log('message posted'); }) .catch(error => { console.log("Error calling API:", error) postMessage({ status: 500 }) }) }