Make it possible to jump between conversation steps
Opened this issue · 4 comments
In the current solution it's not possible to skip a step in a conversation.
Maybe there could be a new method nextConversation(event, "confirmBooking")
, which could create a conversationQueue "on-the-fly". This would make it possible to change the flow of a conversation depending on the input from the user.
That could perhaps remove the need for startConversation(event)
and stopConversation(event)
and also the next
-attribute in the annotation?
Hi,
Can you give a particular use case where you need to skip conversation to get the work done easily which would be instead cumbersome with the existing framework?
If you have a story with two or more branches, it would be nice if you could jump to the branch depending on the input.
I've been tinkering with jbot to create a time reporting bot, and when handling illness my story has at least two branches. The branches can't be handled by the backing queue, it would then require a graph for the conversation steps.
@johkin You may be right about jumping between conversation steps but I think your problem will be solvable with the existing queue as well. You can mention your conversation steps here and I can try to help.
For example, let's say you have a food ordering bot and the 2 branches according to you can be:
- User ordered pizza -> pizza size -> flavour -> quantity
- User ordered burger -> chicken/beef/pork burger -> quantity
Or you can have 1 branch as (with the existing conversation queue structure):
- Take order (pizza or burger) -> If pizza ask size & flavour and if burger ask type -> quantity
In my current example I'm trying to build a time-reporting bot, and the first case I've looked into is handling sickness.
Client: I'm feeling ill.
Bot: Are you ill?
Client: Yes/No
if (no) {
Bot: Oh, I misunderstood! [End conversation]
} else {
Bot: Have you been ill all day?
Client: Yes/No
if (yes) {
Bot: Noted! [End conversation]
} else {
Bot: How long have you been ill?
Client: Half day
Bot: Ok, noted. Get well! [End conversation]
}
}
This conversation can probably be refactored to something using the queue, but after looking at "wit.ai" which now supports branching it seems like a natural thing to support a graph instead of a queue.