Any reason why this should not work even after action_currency_converter is correctly predicted and entities are correctly identified. It returns action listen instead of utter_template.
from typing import Any, Text, Dict, List, Union from rasa_sdk import Action, Tracker from rasa_sdk.executor import CollectingDispatcher from forex_python.converter import CurrencyRates
class CurrencyConverter(Action):
def name(self) -> Text:
return "action_currency_converter"
def run(self, dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
from_currency = tracker.get_latest_entity_values(entity_type = 'currency', entity_role = "from_currency")
to_currency = tracker.get_latest_entity_values(entity_type = 'currency', entity_role = "to_currency")
amount = tracker.get_latest_entity_values("amount")
c = CurrencyRates()
converted = c.convert(from_currency, to_currency, amount)
dispatcher.utter_template("utter_currency_converter", tracker, converted=converted )
return []