0
votes

I'm a noob trying to write my first google assistant webhook using nodejs google action library. While I have my service deployed and accessible with a curl command, I just cannot get it to be invoked from dialogFlow -> integrations -> GoogleAssistant -> Test console.

Also, please note that I haven't used google cloud functions or heroku for deployment. I have a GKE with fission Serverless functions for kubernetes installed. The webhook is a fission function

Some details of what I'm trying to do :

  1. In my dialogFlow app, I've tried to add the exact same intents, actions as mentioned in this post : https://developers.google.com/actions/dialogflow/first-app
  2. PFA screen shots of intents, fulfillment, integration and testing.
  3. From the testing screen shot, after the app asks for my lucky number, its supposed to move on and ask my favorite color, which it doesnt do.
  4. Also, my function on the kubernetes cluster is not being invoked at all.

My code, pasted below, for the function is a very small modification of the index.js from this post https://developers.google.com/actions/dialogflow/first-app

'use strict';

process.env.DEBUG = 'actions-on-google:*';
const App = require('actions-on-google').DialogflowApp;
const functions = require('firebase-functions');


// a. the action name from the make_name Dialogflow intent
const NAME_ACTION = 'make_name';

// b. the parameters that are parsed from the make_name intent
const COLOR_ARGUMENT = 'color';
const NUMBER_ARGUMENT = 'number';


module.exports = async function(context) {
  const app = new App({request: context.request, response: context.response});
  console.log('Request headers: ' + JSON.stringify(context.request.headers));
  console.log('Request body: ' + JSON.stringify(context.request.body));


// c. The function that generates the silly name
  function makeName (app) {
    let number = app.getArgument(NUMBER_ARGUMENT);
    let color = app.getArgument(COLOR_ARGUMENT);
    app.tell('Alright, your silly name is ' +
      color + ' ' + number +
      '! I hope you like it. See you next time.');
  }
  // d. build an action map, which maps intent names to functions
  let actionMap = new Map();
  actionMap.set(NAME_ACTION, makeName);


app.handleRequest(actionMap);
}

Any input/pointers on how to debug this would be immensely beneficial.

Thanks.

1
Can you please update your question with more information about how you are trying to do this and what you're seeing? Screen shots of the test console showing the what you've tried to send, the error, and the debug tab would be helpful. Possibly also screen shots of the Dialogflow intents you think should be triggered?Prisoner
done, thanks for your quick response.user6147402
First, test your webhook URL with rest console from some other machine that is not in your domain. There may be some firewall issue or your webhook is not correctly exposed to the internet.Abhinav Tyagi
Actually, I was able to test my webhook with the DialogFlow's WebDemo UI. It works perfectly. But, not able to test the google assistant integration with it.user6147402
Seems like the issue is more to do with the intent triggering than your webhook. A couple debugging steps: 1) Make sure Small Talk is off in Dialogflow, 2) Try saying just "23" rather than "My lucky number is..." since this should improve the speech recognition for the $number parameterSachit Mishra

1 Answers

-2
votes

I have the same issue, after posting some text with WebDemo UI. Google assistant start working with exact same text.I have no idea how to fix it. but seems its integration bug, or threshold issue with intents detection for Google assistant