Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- firebase > fulfillment({method: 'POST',json: true,body:
- require("project/collabrec/testData.json")});
- Sent request to function.
- firebase > info: User function triggered, starting execution
- info: Fallback intent triggered.
- info: Execution took 15 ms, user function completed successfully
- RESPONSE RECEIVED FROM FUNCTION: 200, {
- "payload": {
- "google": {
- "expectUserResponse": true,
- "richResponse": {
- "items": [
- {
- "simpleResponse": {
- "textToSpeech": "I didn't quite catch that. Could you say that again?"
- }
- }
- ]
- }
- }
- }
- }
- {
- "user": {
- "userId": "ABwppHFR0lfRsG_UM3NkvAptIkD2iUpIUNxFt-ia05PFuPajV6kRQKXu_H_ECMMe0lP_WcCsK64sH2MEIg8eqA",
- "locale": "en-US",
- "lastSeen": "2018-10-19T15:20:12Z"
- },
- "conversation": {
- "conversationId": "ABwppHHerN4CIsBZiWg7M3Tq6NwlTWkfN-_zLIIOBcKbeaz4ruymv-nZ4TKr6ExzDv1tOzszsfcgXikgqRJ9gg",
- "type": "ACTIVE",
- "conversationToken": "[]"
- },
- "inputs": [
- {
- "intent": "actions.intent.TEXT",
- "rawInputs": [
- {
- "inputType": "KEYBOARD",
- "query": "hello"
- }
- ],
- "arguments": [
- {
- "name": "text",
- "rawText": "hello",
- "textValue": "hello"
- }
- ]
- }
- ],
- "surface": {
- "capabilities": [
- {
- "name": "actions.capability.MEDIA_RESPONSE_AUDIO"
- },
- {
- "name": "actions.capability.SCREEN_OUTPUT"
- },
- {
- "name": "actions.capability.AUDIO_OUTPUT"
- },
- {
- "name": "actions.capability.WEB_BROWSER"
- }
- ]
- },
- "isInSandbox": true,
- "availableSurfaces": [
- {
- "capabilities": [
- {
- "name": "actions.capability.SCREEN_OUTPUT"
- },
- {
- "name": "actions.capability.AUDIO_OUTPUT"
- },
- {
- "name": "actions.capability.WEB_BROWSER"
- }
- ]
- }
- ],
- "requestType": "SIMULATOR"
- }
- const {dialogflow, Image} = require('actions-on-google');
- const admin = require('firebase-admin');
- const functions = require('firebase-functions');
- const app = dialogflow();
- app.catch((conv, error) => {
- console.log("Error intent triggered.")
- console.error(error);
- conv.ask('Sorry, I ran into an error. Please try that again.');
- });
- app.fallback((conv) => {
- console.log("Fallback intent triggered.")
- conv.ask("I didn't quite catch that. Could you say that again?");
- })
- app.intent('Default Welcome Intent', (conv) => {
- console.log("Welcome intent triggered.")
- conv.ask("Welcome!!");
- });
- exports.fulfillment = functions.region('europe-west1').https.onRequest(app);
- "@google-cloud/common-grpc": "^0.9.0",
- "@google-cloud/firestore": "^0.17.0",
- "@google-cloud/functions-emulator": "^1.0.0-beta.5",
- "actions-on-google": "^2.4.1",
- "firebase-admin": "^6.0.0",
- "firebase-functions": "^2.0.5"
Add Comment
Please, Sign In to add comment