What is the scenario ?
I am using rasa to fill up a newsletter form which has 2 slots, namely : email of user and frequency of newsletter.
What is the problem in implementing the scenario ?
When the form is activated, only 1 slot (email) is read properly, the other slot (frequency) is not read during the active loop.
Please find details below: domain.yml:
intents:
- affirm
- bot_challenge
- inform_email
- inform_frequency
- subscribe_newsletter entities:
- age
- name
- state
- frequency
slots:
email:
type: text
influence_conversation: true
mappings:
- type: from_entity
entity: email
intent: inform_email
conditions:
- active_loop: bk_news_letter_form frequency: type: text influence_conversation: true mappings:
- type: from_entity
entity: frequency
intent: inform_frequency
conditions:
- active_loop: bk_news_letter_form forms: bk_news_letter_form: required_slots:
- frequency responses: utter_ask_email:
- text: What is you email address ? utter_ask_frequency:
- text: How often do you want to receive emails from me ? actions:
- type: from_entity
entity: email
intent: inform_email
conditions:
- action_newsletter_subscription
rules.yml:
-
rule: activate newsletter form steps:
- intent: subscribe_newsletter
- action : bk_news_letter_form
- active_loop: bk_news_letter_form
- slot_was_set:
- requested_slot: email
- slot_was_set:
- requested_slot: frequency
-
rule: submit form condition:
- active_loop: bk_news_letter_form steps:
- action: bk_news_letter_form
- active_loop: null
- slot_was_set:
- requested_slot: null
- action: action_newsletter_subscription
nlu.yml:
- intent: subscribe_newsletter
examples: |
- I want to get the newsletter
- Can you send me the newsletter?
- Can you sign me up for the newsletter?
- I want to subscribe to a newsletter.
- newsletter
- intent: inform_email
examples: |
- My email is example@example.com
- random@example.com
- Please send it to anything@example.com
- Email is something@example.com
- intent: inform_frequency examples: |
running rasa to use forms:
2022-11-23 18:56:29 INFO root - Starting Rasa server on http://0.0.0.0:5005
2022-11-23 18:56:31 INFO rasa.core.processor - Loading model models/20221123-171919-clear-emporium.tar.gz…
2022-11-23 18:56:53 INFO root - Rasa server is up and running.
Bot loaded. Type a message and press enter (use ‘/stop’ to exit):
Your input → I want to get the newsletter
What is you email address ?
Your input → my email is test1@gmail.com
Your input → -----> this is coming blank
Your input →
rasa details: Rasa Version : 3.3.1 Minimum Compatible Version: 3.0.0 Rasa SDK Version : 3.3.0 Python Version : 3.7.15 Operating System : Darwin-21.6.0-x86_64-i386-64bit
note: now this is the issue, when form is active it only reads 1 slot (email) and not frequency. Expecting : Your input → How often do you want to receive emails from me ?
How can I get the other slot (frequency) working…?