Skip to content

Commit

Permalink
Added new handler and default (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
angelRev committed Oct 26, 2021
1 parent acb83b1 commit 6b4d4be
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion webex_skills/static/mm_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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

0 comments on commit 6b4d4be

Please sign in to comment.