应用程序目前没有响应。 MalformedResponse - 在平台响应中找不到 RichResponse 或 SystemIntent
App isn't responding right now. MalformedResponse - Could not find a RichResponse or SystemIntent in the platform response
我正在尝试完成 Google 操作的代码实验室教程,但 运行 遇到了一些麻烦。我在 "Build Actions for the Assistant (Level 2)".
当我尝试在模拟器中测试动作时,我得到 "My test app isn't responding right now. Try again soon."
请求或响应选项卡中没有任何内容。这是调试选项卡输出:
{
"response": "My test app isn't responding right now. Try again soon.",
"expectUserResponse": false,
"conversationToken": "EvwCS2o5Wk...",
"audioResponse": "//NExAASeH...",
"ssmlMarkList": [],
"debugInfo": {
"sharedDebugInfoList": []
},
"visualResponse": {
"visualElementsList": [
{
"displayText": {
"content": "My test app isn't responding right now. Try again soon."
}
}
],
"suggestionsList": [],
"agentLogoUrl": ""
},
"clientError": 0,
"is3pResponse": true,
"clientOperationList": [],
"projectName": ""
}
我的代码:
'use strict';
// Import the Dialogflow module from the Actions on Google client library.
const {
dialogflow,
Permission,
Suggestions,
} = require('actions-on-google');
// Import the firebase-functions package for deployment.
const functions = require('firebase-functions');
// Instantiate the Dialogflow client.
const app = dialogflow({debug: true});
// Handle the Dialogflow intent named 'favorite color'.
// The intent collects a parameter named 'color'.
app.intent('favorite color', (conv, {color}) => {
const luckyNumber = color.length;
// Respond with the user's lucky number and end the conversation.
if (conv.data.userName) {
conv.close(`${conv.data.userName}, your lucky number is ${luckyNumber}.`);
} else {
conv.close(`Your lucky number is ${luckyNumber}.`);
};
});
app.intent('Default Welcome Intent', (conv) => {
const options = {
context: 'Hi there, to get to know you better',
permissions: ['NAME'],
};
conv.ask(new Permission(options));
});
// Handle the Dialogflow intent named 'actions_intent_PERMISSION'. If user
// agreed to PERMISSION prompt, then boolean value 'permissionGranted' is true.
app.intent('ask permission', (conv, params, permissionGranted) => {
// If they didn't give me permission to use their name...
const options = ['Blue', 'Red', 'Green'];
if (!permissionGranted) {
conv.ask("Ok, no worries. What\'s your favorite color?");
conv.ask(new Suggestions(options));
} else {
// Otherwise, they gave me permission to use it
conv.data.userName = conv.user.name.display;
conv.ask(`Thanks, ${conv.data.userName}. What's your favorite color?`);
conv.ask(new Suggestions(options));
};
});
// Set the DialogflowApp object to handle the HTTPS POST request.
exports.dialogflowFirebaseFulfillment = functions.https.onRequest(app);
"Error" 选项卡中也没有任何内容。我试过寻找 clientError: 0
的含义,看看是否无济于事。我也试过寻找 MalformedResponse 错误,但我没有得到很多有用的信息。
我尝试了各种移动代码或重写代码,但没有任何改变错误消息。我不知道它为什么会坏。
此操作的日志 (https://console.cloud.google.com) 说:
MalformedResponse: ErrorId: a5421d80-def5-42ef-ba55-8ac95a879e14. Failed to parse Dialogflow response into AppResponse because of invalid platform response. : Could not find a RichResponse or SystemIntent in the platform response for agentId: 6edfe023-05da-4726-9ee7-6469f0a5fb3d and intentId: 8ad48133-dd71-496c-b5af-d4ec19e88309
我试过搜索它,但找不到太多有用的信息。
我注意到的另一件事是 https://console.firebase.google.com 上此功能的日志似乎没有更新。我拥有的最后一个日志是在 6 月 2 日,当函数第一次中断时。我不知道为什么它不会更新。如果我 运行 firebase functions:log
,我将有更多最近的条目,如下所示:
2019-06-16T22:20:20.246Z I :
2019-06-16T22:20:21.895Z N dialogflowFirebaseFulfillment:
2019-06-16T22:21:01.674Z N dialogflowFirebaseFulfillment:
2019-06-16T22:27:45.629Z I :
2019-06-16T22:27:47.249Z N dialogflowFirebaseFulfillment:
2019-06-16T22:28:15.351Z N dialogflowFirebaseFulfillment:
2019-06-16T22:59:06.793Z I :
2019-06-16T22:59:08.488Z N dialogflowFirebaseFulfillment:
2019-06-16T22:59:49Z N dialogflowFirebaseFulfillment:
有一次,这些日志在 dialogflowFirebaseFulfillment:
旁边显示 "Undefined",但有些东西发生了变化,我不知道是什么。
任何帮助将不胜感激,因为此时我已经用尽了我能想到的所有选项。
好吧,我终于想通了。我不确定发生了什么变化,但我认为这是 Dialog Flow 中从 V1 到 V2 的迁移(所以教程不是真的正确)并且我在错误的 github 文档中寻求帮助。
这一行...
exports.dialogflowFirebaseFulfillment = functions.https.onRequest(app);
需要改为...
exports.fulfillment = functions.https.onRequest(app);
我感觉这与我在 Firebase 上的部署有关,但让我走上正轨的是查看此页面:https://github.com/actions-on-google/actions-on-google-nodejs
特别是讨论框架和导出到适当框架的部分。
希望这对处于类似情况的其他人有所帮助:)
我正在尝试完成 Google 操作的代码实验室教程,但 运行 遇到了一些麻烦。我在 "Build Actions for the Assistant (Level 2)".
当我尝试在模拟器中测试动作时,我得到 "My test app isn't responding right now. Try again soon."
请求或响应选项卡中没有任何内容。这是调试选项卡输出:
{
"response": "My test app isn't responding right now. Try again soon.",
"expectUserResponse": false,
"conversationToken": "EvwCS2o5Wk...",
"audioResponse": "//NExAASeH...",
"ssmlMarkList": [],
"debugInfo": {
"sharedDebugInfoList": []
},
"visualResponse": {
"visualElementsList": [
{
"displayText": {
"content": "My test app isn't responding right now. Try again soon."
}
}
],
"suggestionsList": [],
"agentLogoUrl": ""
},
"clientError": 0,
"is3pResponse": true,
"clientOperationList": [],
"projectName": ""
}
我的代码:
'use strict';
// Import the Dialogflow module from the Actions on Google client library.
const {
dialogflow,
Permission,
Suggestions,
} = require('actions-on-google');
// Import the firebase-functions package for deployment.
const functions = require('firebase-functions');
// Instantiate the Dialogflow client.
const app = dialogflow({debug: true});
// Handle the Dialogflow intent named 'favorite color'.
// The intent collects a parameter named 'color'.
app.intent('favorite color', (conv, {color}) => {
const luckyNumber = color.length;
// Respond with the user's lucky number and end the conversation.
if (conv.data.userName) {
conv.close(`${conv.data.userName}, your lucky number is ${luckyNumber}.`);
} else {
conv.close(`Your lucky number is ${luckyNumber}.`);
};
});
app.intent('Default Welcome Intent', (conv) => {
const options = {
context: 'Hi there, to get to know you better',
permissions: ['NAME'],
};
conv.ask(new Permission(options));
});
// Handle the Dialogflow intent named 'actions_intent_PERMISSION'. If user
// agreed to PERMISSION prompt, then boolean value 'permissionGranted' is true.
app.intent('ask permission', (conv, params, permissionGranted) => {
// If they didn't give me permission to use their name...
const options = ['Blue', 'Red', 'Green'];
if (!permissionGranted) {
conv.ask("Ok, no worries. What\'s your favorite color?");
conv.ask(new Suggestions(options));
} else {
// Otherwise, they gave me permission to use it
conv.data.userName = conv.user.name.display;
conv.ask(`Thanks, ${conv.data.userName}. What's your favorite color?`);
conv.ask(new Suggestions(options));
};
});
// Set the DialogflowApp object to handle the HTTPS POST request.
exports.dialogflowFirebaseFulfillment = functions.https.onRequest(app);
"Error" 选项卡中也没有任何内容。我试过寻找 clientError: 0
的含义,看看是否无济于事。我也试过寻找 MalformedResponse 错误,但我没有得到很多有用的信息。
我尝试了各种移动代码或重写代码,但没有任何改变错误消息。我不知道它为什么会坏。
此操作的日志 (https://console.cloud.google.com) 说:
MalformedResponse: ErrorId: a5421d80-def5-42ef-ba55-8ac95a879e14. Failed to parse Dialogflow response into AppResponse because of invalid platform response. : Could not find a RichResponse or SystemIntent in the platform response for agentId: 6edfe023-05da-4726-9ee7-6469f0a5fb3d and intentId: 8ad48133-dd71-496c-b5af-d4ec19e88309
我试过搜索它,但找不到太多有用的信息。
我注意到的另一件事是 https://console.firebase.google.com 上此功能的日志似乎没有更新。我拥有的最后一个日志是在 6 月 2 日,当函数第一次中断时。我不知道为什么它不会更新。如果我 运行 firebase functions:log
,我将有更多最近的条目,如下所示:
2019-06-16T22:20:20.246Z I :
2019-06-16T22:20:21.895Z N dialogflowFirebaseFulfillment:
2019-06-16T22:21:01.674Z N dialogflowFirebaseFulfillment:
2019-06-16T22:27:45.629Z I :
2019-06-16T22:27:47.249Z N dialogflowFirebaseFulfillment:
2019-06-16T22:28:15.351Z N dialogflowFirebaseFulfillment:
2019-06-16T22:59:06.793Z I :
2019-06-16T22:59:08.488Z N dialogflowFirebaseFulfillment:
2019-06-16T22:59:49Z N dialogflowFirebaseFulfillment:
有一次,这些日志在 dialogflowFirebaseFulfillment:
旁边显示 "Undefined",但有些东西发生了变化,我不知道是什么。
任何帮助将不胜感激,因为此时我已经用尽了我能想到的所有选项。
好吧,我终于想通了。我不确定发生了什么变化,但我认为这是 Dialog Flow 中从 V1 到 V2 的迁移(所以教程不是真的正确)并且我在错误的 github 文档中寻求帮助。
这一行...
exports.dialogflowFirebaseFulfillment = functions.https.onRequest(app);
需要改为...
exports.fulfillment = functions.https.onRequest(app);
我感觉这与我在 Firebase 上的部署有关,但让我走上正轨的是查看此页面:https://github.com/actions-on-google/actions-on-google-nodejs
特别是讨论框架和导出到适当框架的部分。
希望这对处于类似情况的其他人有所帮助:)