2.4. Multi-turn Dialogue

Create a multi-turn dialogue flow.

All examples in the previous session are single-turn dialogues, where users get to interact with the system only once. Let us design a multi-turn dialogue:

transitions = {
    'state': 'start',
    '`Hello. How are you?`': {
        '[{good, fantastic}]': {
            '`Glad to hear that you are doing well :)`': {
                '[{how, and}, {you, going}]': {
                    '`I feel superb. Thank you!`': 'end'
                }
            }
        },
        'error': {
            '`Got it; thanks for sharing.`': 'end'
        },
    }
}
  • #5: after the system says "Glad to ...", it matches the input with those conditions.

  • #6: if the condition in #5 is true, the system responds with "I feel superb ...".

S: Hello. How are you?
U: Good!
S: Glad to hear that you are doing well :)
U: How are you doing?
S: I feel superb. Thank you!

The condition in #6 does not come with the default action indicated by an error transition. Let us create an error transition for it:

  • #10: prompts the error statement for any other inputs.

Last updated

Was this helpful?