用户存储不持久 [英] User storage not persisting
本文介绍了用户存储不持久的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图保留对话期间获取的值,并使用用户存储在流中的下一个对话中使用它。但是,我的下一个意图是看到用户存储空间为空。
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);
}
推荐答案
我将我的库从 dialogflow-fulfillment-nodejs更改为 actions-on-google-nodejs,并且像个魅力一样。
I changed my library from dialogflow-fulfillment-nodejs to actions-on-google-nodejs and it worked like a charm.
这篇关于用户存储不持久的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文