Rasa Not understanding Greetings - Rasa Pro CALM - Rasa CALM - Rasa Community Forum
👋 Introducing the Rasa Playground
Rasa Not understanding Greetings - Rasa Pro CALM
flows.yml:
flows:
greeting:
description: This flow greets the user.
steps:
- call: user_details
next:
- if: slots.user_name is None AND slots.user_number is None
then:
- call: user_details
next: info_or_loan
- else: info_or_loan
- collect: info_or_loan
id: info_or_loan
user_details:
description: This flow collects the user's name AND phone number.
steps:
- collect: user_name
description: a single letter's string
reset_after_flow_ends: false
rejections:
- if: not (slots.user_name matches "^[A-Za-z]+(?:[-' ]?[A-Za-z]+)*$")
utter: utter_invalid
- collect: user_number
description: number format - (6-9)(XXXXXXXXX)
reset_after_flow_ends: false
rejections:
- if: not (slots.user_number matches "^[6-9]\d{9}$")
utter: utter_invalid
domain.yml:
version: "3.1"
slots:
user_name:
type: text
initial_value: null
mappings:
- type: from_llm
user_number:
type: text
initial_value: null
mappings:
- type: from_llm
responses:
utter_invalid:
- text: "Please provide a valid one."
utter_ask_user_name:
- text: "Can I have your name, please?"
utter_ask_user_number:
- text: "Thank you, {user_name}. Could you please provide your phone number?"
utter_ask_info_or_loan:
- text: "Which one do you want to check out first?"
While I am greeting hi to the bot, it is responding in the way I need it to, as shown in Working Proper image below:
Working Proper1855×764 125 KB](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/3X/0/9/0948ecb8280026d50af1a095d8a441141393adc9.jpeg "Working Proper")
But when i try to greet with other words such as hello, hey, it is taking random value USER as the username or taking the greeting itself as an username.
Not working 21845×767 143 KB](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/3X/e/0/e0e21699112578f4e911c3f2a7c9ef58b009ab4b.jpeg "Not working 2")
Not working 11855×764 125 KB](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/3X/0/9/0948ecb8280026d50af1a095d8a441141393adc9.jpeg "Not working 1")
I don’t understand how different greets have different understandings to take.
Could anyone explain this on rectifying where I am going wrong?
post by jtrasa on Jul 15, 2024
To never skip the collect step in that flow, set ask_before_filling: true in the collect step:
- collect: user_name
description: a single letter's string
ask_before_filling: true
reset_after_flow_ends: false
rejections:
- if: not (slots.user_name matches "^[A-Za-z]+(?:[-' ]?[A-Za-z]+)*$")
utter: utter_invalid
See https://rasa.com/docs/rasa-pro/concepts/flows#always-asking-questions for more details.
post by sk1382 on Jul 15, 2024
Thank you so much for your response. Now the bot is trained good and taking different greetings.