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 :
- 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
- PFA screen shots of intents, fulfillment, integration and testing.
- 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.
- 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.