User storage not persisting

孤者浪人 提交于 2019-12-11 14:59:29

问题


I am trying to keep a hold on values grabbed during the conversation and make it available on the next conversations on the flow using user storage. However I see empty user storage on my next intent. Can someone please advise?

  function askAccountNumber(agent){

      var number = agent.parameters.account_number;   

      let conv = agent.conv();      
      conv.user.storage.account_number = number;                  

      agent.add('Great, your account number is ' + tmp);      
      agent.add('Welcome to the Enacomm banking application. What would you like to do?')      
  }


function askService(agent){

    let conv = agent.conv();
    agent.add(JSON.stringify(conv.user.storage));    //THIS IS BLANK {}      

    var service_type = agent.parameters.service_type; 
    agent.add('Good! You asked for ' + service_type);    
  }

回答1:


This is an open issue on the dialogflow-fulfillment-nodejs library.

I changed my library from dialogflow-fulfillment-nodejs to actions-on-google-nodejs and it worked like a charm.



来源:https://stackoverflow.com/questions/56237477/user-storage-not-persisting

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!