如何使用followUpEvent增加Google Cloud Functions的超时时间

时间:2019-07-09 15:19:28

标签: node.js api google-cloud-functions dialogflow

我创建了一个意图'askPin'。如果为此目的输入 错误,则需要15秒的响应时间。最后是谷歌 模拟器显示“应用程序现在无响应,请重试 以后。”

我已经为askPin创建了FollowUp事件。如果我提供的密码不正确 那么它应该调用其跟进意图。这样它将继续 执行,不会使应用程序崩溃。

  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(err => {  
  if (conv.user.storage.pin_prompt_count > 2)
  conv.close("For security measures your account has been un- 
    linked.\nYou 
     will need to re-link your account to access this skill. \nIf you 
    have 
     forgotten your PIN, please call customer service at <CS phone 
    number> 
     during regular business hours <open hours>. \nThank you. Have a 
     wonderful day.");
  else
   conv.ask("Invalid Pin. Please try again");
  });
  });

在模拟器的响应部分中,显示“无效的密码,请尝试  再次”,但不会在模拟器输出部分中显示。

当前,由于超时问题,它使应用程序崩溃。 所以请如何将Google Cloud功能超时从5增加 秒到1分钟,并且不会使应用程序崩溃。  并请提供创建后续流程的分步流程  事件以增加超时并继续执行  应用。

MalformedResponse:错误ID:c316c2bc-be3b-4c8f-8d9b-2b45434a0325。 由于以下原因,无法将Dialogflow响应解析为AppResponse 无效的平台响应。 :找不到RichResponse或 系统意图 agentId的平台响应:0bc4ed97-dfec-4936-b90d-  28f047eb7b34和intentId:3dcf4b35-00e0-4c75-815c-d1a76494e08e。

0 个答案:

没有答案