diff --git a/webex_skills/static/mm_app.py b/webex_skills/static/mm_app.py index 2a5ad0e..13e65c6 100644 --- a/webex_skills/static/mm_app.py +++ b/webex_skills/static/mm_app.py @@ -5,7 +5,7 @@ api = MindmeldAPI() -@api.handle(intent='greet') +@api.handle(intent='greet', default=True) async def greet(current_state: DialogueState) -> DialogueState: text = 'Hello I am a super simple skill using NLP' new_state = current_state.copy() @@ -17,3 +17,17 @@ async def greet(current_state: DialogueState) -> DialogueState: ] return new_state + + +@api.handle(intent='exit') +async def goodbye(current_state: DialogueState) -> DialogueState: + text = 'Have a nice day!' + new_state = current_state.copy() + + new_state.directives = [ + responses.Reply(text), + responses.Speak(text), + responses.Sleep(10), + ] + + return new_state