File size: 624 Bytes
85784d8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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;
    }
}