Got the error
MalformedResponse Failed to parse Dialogflow response into AppResponse because of empty speech response
had read Failed to parse Dialogflow response into AppResponse because of empty speech response for Ssml response but still did not get the point.
I'm quite a newbie.
Tried to follow the code provided in "Query Data Scalably for Actions on Google using Cloud Firestore", but got the error.
//Copyright 2018 Google LLC.SPDX-License-Identifier: Apache-2.0
'use strict';
const {dialogflow} = require('actions-on-google');
const functions = require('firebase-functions');
const admin = require('firebase-admin');
const app = dialogflow({debug: true});
admin.initializeApp();
const db = admin.firestore();
const collectionRef = db.collection('restaurants');
app.intent('ask_recipe_intent', (conv, {name}) => {
const term = name.toLowerCase();
const termRef = collectionRef.doc(`${term}`);
return termRef.get()
.then((snapshot) => {
const {city, name} = snapshot.data();
conv.ask(`Here you go, ${name}, ${city}. ` +
`What else do you want to know?`);
}).catch((e) => {
console.log('error:', e);
conv.close('Sorry, try again and tell me another food.');
});
});
exports.actionsOracle = functions.https.onRequest(app);
I'm trying to understand what
`${term}`
is and how this is used in Firebase? I don't have any document named "term".
${term}
) ? I don't have any document in Firebase collection called "term", how this is used in Firebase Document? – MubieSam Lin