This commit is contained in:
YasinOnm08 2024-09-20 10:54:21 +02:00
parent 84be9fc2ba
commit f7cab6aec0

View file

@ -11,9 +11,14 @@ onmessage = function (e) {
};
const getResponse = () => {
messageComplete:boolean = false
while(!messageComplete)
axios.get('https://localhost:5000/interstellar/api/ai_get?access_token=' + access_token)
.then(Response => {
postMessage(Response.data.response)
if (Response.data.status == 200) {
messageComplete = true
}
}).catch(error => {
console.error("Error with GET response request:", error)
})