Dialogflow v2 API + Actions v2 API:必须设置MalformedResponse'finimum_response'

mir*_*iro 7 actions-on-google dialogflow-es

我正在尝试与Dialgoflow v2 API一起开始使用Google Actions v2 API.

我有以下示例(到目前为止在Dialogflow - > Fulfillment Webhook中)取自官方的Google Actions Migration Guide,但不幸的是我不断收到MalformedResponse'final_response'必须设置错误.

'use strict';

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

const app = dialogflow();

app.intent('Default Welcome Intent', conv => {
  conv.ask('How are you?');
});

exports.dialogflowFirebaseFulfillment = functions.https.onRequest(app);
Run Code Online (Sandbox Code Playgroud)

响应是:

{
  "responseMetadata": {
    "status": {
      "code": 13,
      "message": "Failed to parse Dialogflow response into AppResponse because of empty speech response",
      "details": [
        {
          "@type": "type.googleapis.com/google.protobuf.Value",
          "value": "{\"id\":\"542fe4a8-6017-429f-81c3-61ba568e3659\",\"timestamp\":\"2018-04-19T20:16:25.606Z\",\"lang\":\"en-us\",\"result\":{},\"status\":{\"code\":200,\"errorType\":\"success\"},\"sessionId\":\"1524168985362\"}"
        }
      ]
    }
  }
}
Run Code Online (Sandbox Code Playgroud)

请知道为什么会发生这种情况?

mat*_*yne 6

改变这一行:

conv.ask('How are you?');

对此:

conv.close('How are you?');

close方法final_response为您配置所需的字段