Hello there, Currently using Rasa 1.10.24. I have this bilingual bot that can speak English and Arabic. I have this custom action that prompts answer according to type of entity, that looks like this:
class EntityAction(Action):
def name(self) -> Text:
return "action_entity"
def run(self,
dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any]):
entity_value = tracker.get_latest_entity_values()
intent_value = tracker.get_intent_of_latest_message(skip_fallback_intent=True)
entity_type = tracker.latest_message['entities'][0]['entity']
if intent_value == "beverage" and entity_type == "juice":
dispatcher.utter_template("utter_beverage_juice", tracker)
elif intent_value == "beverage" and entity_type == "tea":
dispatcher.utter_template("utter_beverage_tea", tracker)
(I have different utterance templates for both)
My responses look like this: utter_user_asking_beverage_juice: - text: سأقوم ببعض الأبحاث حتى أتمكن من مشاركة المزيد حول {juice} قريبًا.
The same goes for English. My problem is this, when this is called for English, {juice} is replaced with entity value (e.g. orange juice) but this doesn’t apply for Arabic, dispatcher utters above sentence, (literally) “سأقوم ببعض الأبحاث حتى أتمكن من مشاركة المزيد حول {juice} قريبًا.” I debugged the custom action and the agent is able to catch the entity and entity value, it just doesn’t plug it in. My suspection is Arabic being right to left and causing a problem. Any help is appreciated.