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)]