Version: dev-CC here is my action file: from rasa_sdk import Tracker from rasa_sdk.executor import CollectingDispatcher
from typing import Dict, Text, Any, List import pickle import requests from rasa_sdk import Action from rasa_sdk.events import SlotSet, FollowupAction from rasa_sdk.forms import FormAction
class FindLocation(Action):
def name(self) -> Text:
return "find_location"
def run(self,
dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text ,Any]) -> List:
data = pickle.load(open("PincodeDict.p","rb"))
buttons = []
pincode = tracker.get_slot("pincode")
print(pincode)
places = data[int(pincode)]
print(places)
for li in places:
buttons.append({"title":li , "payload":'/inform{"location":'+'"'+li+'"'+"}"})
dispatcher.utter_button_template("utter_ask_location1",buttons,tracker)
return []
class FindHealthCareAddress(Action): “”“This action class retrieves the address of the user’s healthcare facility choice to display it to the user.”""
def name(self) -> Text:
"""Unique identifier of the action"""
return "find_healthcare_address"
def run(self,
dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any]) -> List[Dict]:
facility = "Hospital"
address = "300 Hyde St, San Francisco"
return [SlotSet("facility_address", address)]
class actionfallback(Action):
def name(self) -> Text:
"""Unique identifier of the action"""
return "action_fallback"
def run(self,
dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any]) -> List[Dict]:
dispatcher.utter_message("utter_ask_for_pincode")
return []
here All the functions are working except class FindLocation. here I have used a pickle file it is loaded perfectly. I have tested by running in python in the virtual environment. Please help!! yes it works perfectly with rasa core in my system