I have created an intent in Dialogflow web interface. It auto detected a parameter called given-name, which lists it as $given-name
in the web interface. I am trying to address $given-name
in the fulfillment inline editor provided by the web interface, but I am not having any success.
I've tried changing the parameter name to camel case, and also alternatively to using an underscore to replace the hyphen but neither seemed to work.
Here is the code snippet from the dialogflow fulfillment inline editor:
'use strict';
// Import the Dialogflow module from the Actions on Google client library.
const {dialogflow} = require('actions-on-google');
// Import the firebase-functions package for deployment.
const functions = require('firebase-functions');
// Instantiate the Dialogflow client.
const app = dialogflow({debug: true});
// Can't address given-name, intentionally used an underscore
app.intent('run demo', (conv, {given_name}) => {
conv.close('Hi ' + given_name +'! This is the demo you asked me to run!');
});
// Set the DialogflowApp object to handle the HTTPS POST request.
exports.dialogflowFirebaseFulfillment = functions.https.onRequest(app);
I want to know the correct way to address the given name parameter in the code section app.intent('run demo', (conv ...);