firebasegoogle-cloud-functionsassistant

Http request not working in Firebase webhook for google assistant


I have created the simple firebase function for Google assistant but when I try to send HTTP request I got an error in google actions simulator MalformedResponse 'final_response' must be set. The next action works properly:

app.intent('Default Welcome Intent', (conv) => {
    conv.ask(`What do you want?`);
});

But the next is not working (produce the previous error):

app.intent('turnOff tv', (conv) => {
    request('http://someurl.com', (res) => {
        conv.ask('Alright, your value is');
    });
});

I was installing request module before (npm install request --save). And I'm using the free firebase account.

How can I make an HTTP request in Firebase function while triggering a Google action from Google home?

Thanks!


Solution

  • Sadly, using the free plan for Google Functions, you cannot trigger a request for an external service other than Google. The firebase free plan allows outbound networking to Google Services only.

    Source: Firebase pricing for details.