简体   繁体   English

Google Assistant上的MalformedResponse错误

[英]MalformedResponse Error on Google Assistant

I am calling a third-party API to fetch data. 我正在调用第三方API来获取数据。 In a situation when the API returns error I can't continue my user flow on the Google Assitant 在API返回错误的情况下,我无法继续在Google助手上进行用户访问

Error I see in Google Cloud Console is as follows: 我在Google Cloud Console中看到的错误如下:

"MalformedResponse: ErrorId: c316c2bc-be3b-4c8f-8d9b-2b45434a0325. 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: 0bc4ed97-dfec-4936-b90d-28f047eb7b34 and intentId: 3dcf4b35-00e0-4c75-815c-d1a76494e08e" “ MalformedResponse:错误ID:c316c2bc-be3b-4c8f-8d9b-2b45434a0325。由于无效的平台响应而未能将Dialogflow响应解析为AppResponse。 -28f047eb7b34和intentId:3dcf4b35-00e0-4c75-815c-d1a76494e08e“

Here is my intent code. 这是我的意图代码。

app.intent('askPin', (conv, params) => {

  conv.user.storage.pin_prompt_count = conv.user.storage.pin_prompt_count + 1;

  var member = services.getMemberDetails(memberId, params.account_pin);

  return member.then(function (result) {

    if (result) {
      conv.user.storage.pin_prompt_count = 0; //reset prompt count once verified
      conv.user.storage.account_pin = params.account_pin;
      conv.contexts.delete('account-pin-context');//delete context to pin intent will not be invoked again.

      return handleService(conv);
    }
  }).catch(function (err) {
    console.log("Paresh Varde 1");
    conv.ask("Invalid Pin. Please try again");
  })
});

Here is the Response I see being generated from the log 这是我看到从日志生成的响应

{
  "status": 200,
  "headers": {
    "content-type": "application/json;charset=utf-8"
  },
  "body": {
    "payload": {
      "google": {
        "expectUserResponse": true,
        "richResponse": {
          "items": [
            {
              "simpleResponse": {
                "textToSpeech": "Invalid Pin. Please try again"
              }
            }
          ]
        }
      }
    }
  }
}

I don't see any error in the firebase console (where the function is deployed). 我在firebase控制台(已部署功能)中看不到任何错误。 However I see an error in Google Cloud console as follows: 但是,我在Google Cloud Console中看到如下错误:

MalformedResponse: ErrorId: c316c2bc-be3b-4c8f-8d9b-2b45434a0325. 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: 0bc4ed97-dfec-4936-b90d-28f047eb7b34 and intentId: 3dcf4b35-00e0-4c75-815c-d1a76494e08e

I see a message on my simulator as "App isn't responding right now. Try again soon." 我在模拟器上看到一条消息,提示“应用程序当前无响应。请稍后重试。” and it leaves the conversation. 它离开了对话。

Please advise. 请指教。

The problem was that my webhook call was taking more than 5 seconds to complete. 问题是我的Webhook呼叫需要5秒钟以上才能完成。 Webhook must complete it's execution in less than 5 seconds to work properly and make the conversation smooth. Webhook必须在不到5秒的时间内完成其执行,才能正常工作并使对话流畅。

For now, I need to work out my REST interface so that API I am calling respond quickly to achieve this timeout limit. 现在,我需要计算我的REST接口,以便我正在调用的API快速响应以实现此超时限制。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Dialogflow,Google助手:出现错误“必须设置MalformedResponse'final_response'” - Dialogflow, Google Assistant: Getting error “MalformedResponse 'final_response' must be set” Google登录助手时出错 - Error in Google Sign in for the Assistant 使用Dialogflow在Google App上的主机操作在自托管HTTPS服务器上使用节点JS(MalformedResponse:Webhook错误(206)) - Host Actions On Google App With Dialogflow Using Node JS on Self Hosted HTTPS Server (MalformedResponse: Webhook error (206)) 在Dialogflow上没有错误时,Google智能助理出错 - Error on Google Assistant while no error on Dialogflow Google助手-部署第一个应用程序时出错 - Google assistant - error when deploy first app Google Assistant意向响应中的SSML MalformedRequest错误 - SSML MalformedRequest error in Google Assistant intent response 启动Google Assistant控制台时出现DialogFlow错误 - DialogFlow error when launching Google Assistant Console 谷歌助手和Dialogflow教程 - Tutorial in google Assistant and Dialogflow Google智能助理的事实应用 - Fact App for Google Assistant 谷歌DialogFlow V2实现中的神秘错误(谷歌助手模拟器空响应,请求,错误选项卡) - Google DialogFlow V2 mysterious error in fulfillment (Google Assistant simulator empty response, request, error tab)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM