Hello I’m trying to get the bot to run this very simple custom action,
from typing import Any, Text, Dict, List
from rasa_sdk import Action, Tracker
from rasa_sdk.executor import CollectingDispatcher
class Math(Action):
def name(self) -> Text:
return "action_math"
def run(self, dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
mathVar = (tracker.latest_message)['text']
mathVar = ''.join(char for char in mathVar if char not in 'abcdefghijklmnopqrstuvwxyz')
mathVarCalculate = eval(mathVar)
dispatcher.utter_message(mathVarCalculate)
from what i can tell the action itself is executed as i should but when the bot is supposed to say the answer through dispatcher.utter_message it say nothing keeps working for a while and then gives me this error message,
Task exception was never retrieved
future: <Task finished coro=<RestInput.on_message_wrapper() done, defined at /Users/filipw/Documents/ConvoAi/anaconda3/lib/python3.7/site-packages/rasa/core/channels/channel.py:386> exception=AttributeError("‘int’ object has no attribute ‘split’")>
Does anyone know why?