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:
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.
I don’t understand how different greets have different understandings to take.
Could anyone explain this on rectifying where I am going wrong?