0

I am working on WIT Chat Bot... i have a story, in that i am asking for the quick replies Yes or No. if user press Yes or No. I have to make another call on WIT with context. So how can i set quick replies into context. how to handle quick replies.

i have tried for another contexts i am updating context like below.. context.getContext().remove("reasons_cancellation"); context.getContext().put("cancelbutton_pressed", true);

but i am not sure with quick reply keys and possible values

Dhruvit Darji
  • 205
  • 2
  • 14

1 Answers1

0

If I understand you correctly, you are looking to handle yes_no entity of quick replies feature in wit.ai.

In case of handling quick replies like yes/no, you would need to add 'Yes' and 'No' as quick replies to very latest 'bot says' statement.

After that, you need to have Yes & No as User's next response statement. Note, Yes & No would need to be shown as branch. In user response of yes/no, use yes_no entities with value of yes or no in respective branches.

Once this is specified, specify an action with a name. yes_no entity will be passed to the action. In your action implementation (your server side logic), you need to retrieve value of yes_no entity, use it and assign the value in context when needed.

Hope this helps.

  • @dhruvit-darji you can look at this recipe for better clarity. [Recipe](https://wit.ai/docs/recipes#handle-yesno-answers) – Puneet kankane Jan 13 '17 at 15:46
  • yes.. i have gone through the requirement.. and understood the flow... but the issue is that ... i can not able to set context as per user selection.. what i am doing ... context.getContext().put("quickreplies", "Yes"); – Dhruvit Darji Jan 16 '17 at 05:31