how can add Multilingual response in domain.yml
Use conditional response variations to output according to the language slot.
responses:
utter_greet:
- condition:
- type: slot
name: language
value: ar
text: "Ahla, kifak?"
- condition:
- type: slot
name: language
value: fr
text: "Bonjour, comment allez-vous?"
- text: "Hello, how are you?"
@ChrisRahme error rasa.core.actions.action - Couldn’t create message for response utter_greet
Do you have a language slot?
@ChrisRahme `responses: utter_greet: - condition: - type: slot name: language value: en text: " You are in the registration & membership area to register in the available programs please choose your preferred program."
- condition:
- type: slot
name: language
value: ar
text: "
للرجوع لقائمة الخدمات الرئيسية يرجى كتابة "القائمة الرئيسية" أو أياً من
الكلمات الرئيسية لعرضها."
`
Please properly format code on the Forum by using three backticks (```) before and after the code
```
like this
```
I ask again, do you have a language slot?
utter_greet:
- condition:
- type: slot
name: language
value: en
text: " You are in the registration & membership area to register in the
available programs please choose your preferred program.
To know more about memberships policy, visit the following link"
- condition:
- type: slot
name: language
value: ar
text: "
للرجوع لقائمة الخدمات الرئيسية يرجى كتابة القائمة الرئيسية أو أياً من
الكلمات الرئيسية لعرضها. "
Thank you for formatting properly.
For the 3rd time please answer: Do you have a language
slot?
If you don’t know what a slot is, please read https://rasa.com/docs/rasa/domain#slots.
If you don’t have a language slot, how are you detecting and saving the language?
@ yes
Can you show me how you defined the slot, and how you’re filling it?
slots:
language:
type: text
responses:
utter_N1_wHyBJE:
- condition:
- type: slot
name: language
value: en
text: |-
This is Omar from the Virtual Department.
Welcome to Sharjah Capability Development.
I will be your guide in this exceptional experience.
- condition:
- type: slot
name: language
value: ar
text: |-
أنا الموظف عمر من القسم الافتراضي
"مرحباً بكم في مؤسسة الشارقة لتطوير القدرات “تطوير
سأكون سعيد بخدمتكم في هذه الرحلة الاستثنائية
utter_OQGcx7KTc:
- condition:
- type: slot
name: language
value: ar
text: >-
للرجوع لقائمة الخدمات الرئيسية يرجى كتابة "القائمة الرئيسية" أو أياً من
الكلمات الرئيسية لعرضها.
- condition:
- type: slot
name: language
value: en
text: >-
Return to the main list of services Please type "main list" or any of the keywords to display it.
How are you filling the slot?
@ChrisRahme you can make example for this point
Look at my project: https://github.com/ChrisRahme/fyp-chatbot
I built it before conditional response variations were stable, so the conditions are all in custom actions not in the domain.
I’m filling the language
slot via a custom action that gives buttons which the user presses and it will set the slot.