hongbo-miao/hongbomiao.com

View on GitHub
machine-learning/hm-rasa/data/rules.yml

Summary

Maintainability
Test Coverage
---
version: "3.1"
rules:
  - rule: Say goodbye anytime the user says goodbye
    steps:
      - intent: goodbye
      - action: utter_goodbye

  - rule: Say 'I am a bot' anytime the user challenges
    steps:
      - intent: bot_challenge
      - action: utter_iamabot

  - rule: Activate the pizza form
    steps:
      - intent: buy_pizza
      - action: pizza_form
      - active_loop: pizza_form
  - rule: Submit the pizza form
    condition:
      - active_loop: pizza_form
    steps:
      - action: pizza_form
      - active_loop: null
      - slot_was_set:
          - requested_slot: null
      - action: utter_order_pizza

  - rule: Interruption in the pizza form
    condition:
      # Condition that form is active.
      - active_loop: pizza_form
    steps:
      # This unhappy story handles the case of an intent `bot_challenge`.
      - intent: bot_challenge
      - action: utter_iamabot
      # Return to form after handling the `bot_challenge` intent
      - action: pizza_form
      - active_loop: pizza_form