PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, November 3, 2022

[FIXED] Why am I getting 'no dialogflow intent detected' on Lambda but it works fine on Google Cloud Functions?

 November 03, 2022     dialogflow-es, google-cloud-functions, lambda, node.js     No comments   

Issue

I am building a Dialogflow agent and am migrating the fulfilment code from Google Cloud Functions over to AWS Lambda. Here is the entry code:

    'use strict';

/* CONSTANTS AND GLOBAL VARIABLES */

const functions = require('firebase-functions');
const { dialogflow } = require('actions-on-google');

const app = dialogflow({ debug: true });
const intents = require('./intentsController.js');

app.middleware(conv => {
    conv.hasScreen =
        conv.surface.capabilities.has('actions.capability.SCREEN_OUTPUT');
    conv.hasAudioPlayback =
        conv.surface.capabilities.has('actions.capability.AUDIO_OUTPUT');
});

app.intent('Welcome Intent', intents.welcomeIntent)

/* INTENT HANDLERS */

app.intent('Default Fallback Intent', intents.fallBackIntent);

app.intent('Find Multiple Posts Intent', intents.multiplePostsIntent);

exports.testFunction = functions.https.onRequest(app);

When viewing the cloudwatch logs from Lambda, Im getting this error:

"errorType": "Runtime.UnhandledPromiseRejection", "errorMessage": "Error: No intent was provided and fallback handler is not defined.",

When viewing the requests on AWS vs Google Cloud, AWS looks like its keeping the JSON in the request body as a string. Why would this work differently on Lambda and what am I doing wrong here?


Solution

It turns out that I was using the wrong API Gateway type. I was creating an http API when I should have used a REST API. Switching over to REST fixed the issue.



Answered By - Adam B
Answer Checked By - Gilberto Lyons (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing