gpt4 book ai didi

actions-on-google - Dialogflow v2 API + Actions v2 API : MalformedResponse 'final_response' must be set

转载 作者:行者123 更新时间:2023-12-04 12:03:32 24 4
gpt4 key购买 nike

我正在尝试开始使用 Google Actions v2 API 和 Dialgoflow 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);

回应是:
{
"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\"}"
}
]
}
}
}

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

最佳答案

改变这一行:
conv.ask('How are you?');
对此:
conv.close('How are you?');close方法配置所需的 final_response给你的领域

关于actions-on-google - Dialogflow v2 API + Actions v2 API : MalformedResponse 'final_response' must be set,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49929656/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com