wit icon indicating copy to clipboard operation
wit copied to clipboard

multiple yes/no in one story

Open mega-siswanto opened this issue 9 years ago • 1 comments

Hello, I'm making an AI that handles booking appointment request. In this app, I need to implement error handling in cases where user types gibberish or invalid input. I am having trouble understanding how wit.ai actually determine which actions or responses are executed, as many times I've encountered unexpected actions or responses while testing my bot.

Here is a simpler version of the app I'm currently building.

For example, this is one of the problem I encountered and it does not make sense to be as I've set the correct context keys: User: book ||> updateIntent() ||> getCalendars() Bot: Hi {name}! Please choose your preferred doctor (enter {calendarsSelection}):
{calendars} User: aaa ||> chooseCalendar() Bot: Please type a valid number (enter {calendarsSelection}) User: 3 ||> chooseCalendar() Bot: What is your preferred date and time for your appointment? User: 3 mar 3pm ||> chooseDateTime() ||> checkAvailability() Bot: Would you like to receive notification via email? User: aaa ||> checkYesNo() ||> getEmail() --> this should not have been executed in the first place as I have set the 'invalidYesNo' context key

The log: screen shot 2017-03-03 at 6 26 08 pm

The problematic part in wit.ai story: screen shot 2017-03-03 at 6 26 32 pm As you can see, the getEmail functions shouldn't have been triggered because I didn't set the context key for 'yes'.

Did using a lot of "yes" and "no" in a different context cause this crash (I do have multiple yes/no in one story)? Or am I structuring the flow wrongly in wit.ai?

mega-siswanto avatar Mar 03 '17 10:03 mega-siswanto

Closing since we will stop Stories and serving requests to the associated /converse endpoint on February 1, 2018: https://wit.ai/blog/2017/07/27/sunsetting-stories

l5t avatar Jan 22 '18 01:01 l5t