Reputation: 392
I am developing a chat bot using Python, celery, and the MS bot framework. I want to add small dialogs like the following:
User: Hi
User: Order me fries.
Bot: ok. address?
User: xyz, state, 82288
Bot: Got it. I will order fries for you.
Here, how can I temporarily store fries to access it after the user gives me the address?
Also, I think it should be acceptable for my use case to forget what the order was if the user does not respond for 2-3 minutes. So, I can also have a timeout for the stored variable.
I thought of using redis. I am thinking of storing something like the following in a redis db:
{
'conversationId':['orderitem':'fries','address':'state, pincode']
}
basically a key,value pair with key=conversationId and value='order,address'.
So, does this look a good option?
Upvotes: 0
Views: 2244
Reputation: 14787
You should consider using the Bot State REST API to manage state within the bot.
The bot can manage 3 types of state data, out-of-the-box:
Upvotes: 3