为什么我在 Lambda 上得到 'no dialogflow intent detected' 但它在 Google Cloud Functions 上工作正常?

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

我正在构建 Dialogflow 代理并将实现代码从 Google Cloud Functions 迁移到 AWS Lambda。这是入口代码:

    '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);

从 Lambda 查看 cloudwatch 日志时,我收到此错误:

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

在 AWS 与 Google 云上查看请求时,AWS 看起来像是将请求正文中的 JSON 作为字符串保留。为什么这在 Lambda 上会有所不同,我在这里做错了什么?

原来我用错了 API 网关类型。当我应该使用 REST API 时,我创建了一个 http API。切换到 REST 解决了这个问题。