I have two intents get_name and get_age
in get_name I take the user name, this intent is enabled for fulfillment. In the editor, how to ask for confirmation of the name?
if confirmed, then I should add output context to get_name, so that get_age intent gets invoked.
i tried using the conv object to start a conversation without leaving the intent, but it does not even call the function.
function confirmation(agent){
var entity_name = agent.name;
var name = agent.parameters.name;
var conv = agent.conv();
conv.ask(`Is ${name} correct?`);
agent.add(conv);
var user_query = conv.query;
if(user_query.entities.name=='yes'){
agent.setContext({
name: `${entity_name}`+'_done',
lifespan: 2
});
agent.add(`Give your age ${name}`);
}
}