interpretador-de-texto-ii / static /services /InterpretadorService.js
tiagoenriquez's picture
Upload 49 files
85784d8 verified
class InterpretadorService {
/**
*
* @param {string} texto
* @param {string} pergunta
* @returns {Promise<InterpretadorResponse>}
*/
responder = async (texto, pergunta) => {
const request = new InterpretadorRequest(texto, pergunta);
const options = new Options("POST", request);
/**
* @type {Promise<InterpretadorResponse>}
*/
const response = await fetch(urlApi, options).then((response) => {
return response.json();
}).catch((error) => {
console.log(error);
});
return response;
}
}