RASA dispatch utter message not working

i want to use dispatcher.utter_message to display the message even when slot is not none or not found how can i do. i have written below code for custom action where slot is sometimes not found but i want to dispatch the message. How can i do that. I think the issue is the message is not able to hit class ‘action_weather’

from future import absolute_import from future import division from future import unicode_literals

from rasa_core_sdk import Action from rasa_core_sdk.events import SlotSet import pandas as pd

df = pd.read_excel(“C:\Samples\faqxxx.xlsx”)

class ActionWeather(Action):

def name(self):
    return 'action_weather'

def run(self,dispatcher, tracker, domain):
    loc = tracker.get_slot('faq')
    msg=tracker.latest_message['text']
    print(msg)
    intent_name = tracker.latest_message['intent'].get('name')
    result = df['fixit'][df['faq'] == intent_name]
    dispatcher.utter_message(result[0])
    return [SlotSet('faq', loc)]

I think the issue is the message is not able to hit class ‘action_weather’

Do you mean that the action action_weather is not being called? It’s helpful to talk to your bot in the command line on --debug mode to see what actions are being called and run.

yes that is my issue how can i pass the action with my message to the chatbot ?

If the problem is that your action is not being called, then the issue is with your stories, not your action itself. I would recommend training your bot with interactive learning to make sure your stories are structured correctly.

1 Like

Thanks for the help :slight_smile: