Reputation: 2268
I'm trying to make a chatbot using API.AI with Javascript and JQuery. I need to the following.
Bot: Hi, I'm a chatbot. What's your name?
User: Hi, I'm John Doe
Bot: How can I help you John Doe?
The bot should be able to capture the user's name and should be able to chat with the user by the his/her name. I have tried lots of things but I could't figure out a proper way to implement this.
Upvotes: 1
Views: 2516
Reputation: 1023
That's simple.
You can see this parameter is stored in result -> parameters, as well in result -> context -> user-name -> given name. In order to enhance the lifespan of this context, you either give it a manual high lifespan or better, renew it by using it in other intents as an output. When using it as an input you can limit the user to intents, when they didn't tell you their name.
Upvotes: 2