wit icon indicating copy to clipboard operation
wit copied to clipboard

When stops a story if I loop back from the end

Open misysdclabs opened this issue 10 years ago • 4 comments

(maybe it is connected to my other question: #258)

Let's say I have a story with multiple entities (X and Y). The user asks a question with a couple of params (a for X and b for Y), and get and answer. Than asks again (c for X), and my bot gives an answer by mixing the current params with the previous ones (c for X and b for Y). To handle this I looped back my story to the beginnig: screen shot 2016-07-07 at 17 02 26

Works perfeclty but I have a problem. It never ends. So can't stop it, the user can't change the topic. Here is a log from my node.js client, using the interactive mode:

sessionId: db101f20-4453-11e6-9791-2557834e9851

What was my favorite topping in June? fav_topping context in: {} entities in: {"contact":[{"confidence":0.9965486088458536,"type":"value","value":"my","suggested":true}],"datetime":[{"confidence":0.9954243915206602,"type":"value","value":"2017-06-01T00:00:00.000-07:00","grain":"month","values":[{"type":"value","value":"2017-06-01T00:00:00.000-07:00","grain":"month"},{"type":"value","value":"2018-06-01T00:00:00.000-07:00","grain":"month"},{"type":"value","value":"2019-06-01T00:00:00.000-07:00","grain":"month"}]}],"intent":[{"confidence":0.9969200405818317,"value":"fav_topping"}]} context out is: {"ft_answer":"_Your favorite topping was tomato for sure :) *"} sending... {"text":"_Your favorite topping was tomato for sure :) _"} and in June? fav_topping context in: {"ft_answer":"_Your favorite topping was tomato for sure :) _"} entities in: {"datetime":[{"confidence":0.994470434703695,"type":"value","value":"2017-06-01T00:00:00.000-07:00","grain":"month","values":[{"type":"value","value":"2017-06-01T00:00:00.000-07:00","grain":"month"},{"type":"value","value":"2018-06-01T00:00:00.000-07:00","grain":"month"},{"type":"value","value":"2019-06-01T00:00:00.000-07:00","grain":"month"}]}]} context out is: {"ft_answer":"_Your favorite topping was tomato for sure :) _"} sending... {"text":"_Your favorite topping was tomato for sure :) _"} OK, I want a normal pizza with tomato and pepperoni fav_topping context in: {"ft_answer":"_Your favorite topping was tomato for sure :) _"} entities in: {"contact":[{"confidence":0.5452832324099028,"type":"value","value":"I","suggested":true}],"pizza_size":[{"confidence":0.9769454518025678,"type":"value","value":"middle"}],"pizza_topping":[{"confidence":0.9934795348369287,"type":"value","value":"tomato"},{"confidence":0.9505825366331593,"type":"value","value":"pepperoni"}],"intent":[{"confidence":0.6669035510798399,"value":"order_pizza"}]} context out is: {"ft_answer":"_Your favorite topping was tomato for sure :) _"} sending... {"text":"_Your favorite topping was tomato for sure :) _"} Book me a table for 5 persons at 9pm fav_topping context in: {"ft_answer":"_Your favorite topping was tomato for sure :) _"} entities in: {"contact":[{"confidence":0.8387365394318869,"type":"value","value":"me","suggested":true}],"number":[{"confidence":1,"type":"value","value":5}],"datetime":[{"confidence":1,"type":"value","value":"2016-07-07T21:00:00.000-07:00","grain":"hour","values":[{"type":"value","value":"2016-07-07T21:00:00.000-07:00","grain":"hour"},{"type":"value","value":"2016-07-08T21:00:00.000-07:00","grain":"hour"},{"type":"value","value":"2016-07-09T21:00:00.000-07:00","grain":"hour"}]}],"intent":[{"confidence":0.9997353858626356,"value":"reserve_table"}]} context out is: {"ft_answer":"_Your favorite topping was tomato for sure :) _"} sending... {"text":"_Your favorite topping was tomato for sure :) *"}

log in pictures from the site: screen shot 2016-07-07 at 17 20 16 screen shot 2016-07-07 at 17 20 29

The question is: how can I tell manually/programatically to the BE to finish the story?

As @ar7hur mention in the other issue's thread (#258) the BE try to find out automatically when to finish current story and go into another one. Maybe this should work also for this kind of scenarios?

One more note: as you can see in my log the BE understands well that the user started a new topic (recognize that the intent changed to 'order_pizza' and 'reserve_table'). Maybe could help a lot if I could define explicitly the intent for the story. What do you think? (not a big change to what we have now: defining the first sentence of the story)

misysdclabs avatar Jul 07 '16 15:07 misysdclabs

Can somebody give me any hints to solve this or do a workaround?

misysdclabs avatar Jul 11 '16 14:07 misysdclabs

Why won't you put in your story a message from the bot which says :

"Would you like to find another fav topping ?" and then a quick answer: yes no question with 2 branches case "yes" it jumps to the bookmark case "no" bot says "bye bye" ?

thomasnivot avatar Nov 16 '16 15:11 thomasnivot

thanks, a nice workaround. However, this sounds really artificial...ask back after every fav topping question.

misysdclabs avatar Nov 16 '16 15:11 misysdclabs

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