MalformedResponse:无法将 Dialogflow 响应解析为 AppResponse:索引:0

MalformedResponse : Failed to parse Dialogflow response into AppResponse: Index: 0

我在列表响应中添加了一些项目,以便用户可以 select 列表中的项目

场景

bot: hello what you want to update (list will open with options as{title, objective, place})
user: title {selects either by clicking or typing}
bot: Enter your title (webhook response)
user: xyz
bot: record updated
but the issue is when user clicks on any item it gives me an error

"Sorry, Test Apps isn't responding right now. Please try again soon."

这个错误的原因是

格式错误的响应 无法将 Dialogflow 响应解析为 AppResponse:索引:0。

这是我的代码

app.intent(CREATE_INTENT, (conv) => {
conv.ask("Here's the list");
  conv.ask(new List({
    title: "Select an option to update",
    items: {     
      'SELECTION_KEY_TITLE': {
        synonyms: [
          'Title',
          'title',
        ],
        title: 'title',
        description: 'Click here to update title',
        image: new Image({
          url: 'https://storage.googleapis.com/actionsresources/logo_assistant_2x_64dp.png',          alt: 'Image alternate text',
        }),
      },

      'SELECTION_KEY_PLACE': {
        synonyms: [
          'place',
          'Place',
      ],
        title: 'place',
        description: 'This is for updating your city name',
        image: new Image({
          url: 'https://storage.googleapis.com/actionsresources/logo_assistant_2x_64dp.png',          alt: 'Google Home',
        }),
      },

      'SELECTION_KEY_OBJECTIVE': {
        synonyms: [
          'objective',
          'Objective',
        ],
        title: 'objective',
        description: 'select to update objective',
        image: new Image({
          url: 'https://storage.googleapis.com/actionsresources/logo_assistant_2x_64dp.png',          alt: 'Google Pixel',
        }),
      },
    },
  }));

app.intent(TITLE_INTENT, (conv, option) => {  
       if (option === SELECTION_KEY_TITLE) {
     conv.ask("Please enter your resume title");
     } else if (option === SELECTION_KEY_PLACE) {
     conv.ask("What's your current city?");
     } else if (option === SELECTION_KEY_OBJECTIVE) {
     conv.ask("Please enter your objective");
     } else {
         conv.ask('Sorry! please select one option to update.');
         conv.ask(new Suggestions(['Title', 'Place', 'Objective']));
     }
});

你的屏幕截图表明你有一个列表,你正在通过触摸它与之交互 - 但你说你没有任何网络挂钩。 Handling a list interaction 只能通过 webhook 处理。

您没有显示所有意图,但似乎调用了后备意图(正如您在评论中提到的那样),因为您没有处理 action_intent_OPTION 事件的意图.

听起来您可能想使用 suggestion chips 而不是列表。 Suggestion Chips 有助于指导用户如何继续对话,而 Lists 有助于呈现结果并让用户 select 这些结果之一。建议信息块也完全按照用户所说或输入的方式处理,不需要特殊处理即可处理。

我发现了这个问题,我们必须从 TITLE_INTENT 中删除所有训练短语,并确保在事件部分中您必须添加 actions_intent_OPTION