Create a multi-turn dialogue flow.
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'
},
}
}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!S: Hello. How are you?
U: Fantastic
S: Glad to hear that you are doing well :)
U: Thank you!
Traceback (most recent call last):
...def multiturn_dialogue() -> DialogueFlow:
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': {
'`You are the best!`': 'end'
}
}
},
'error': {
'`Got it; thanks for sharing.`': 'end'
},
}
}
df = DialogueFlow('start', end_state='end')
df.load_transitions(transitions)
return df
if __name__ == '__main__':
multiturn_dialogue().run()S: Hello. How are you?
U: Fantastic!
S: Glad to hear that you are doing well :)
U: Thank you!
S: You are the best!