问题
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