Hi… I want to read the json file in custom action file to do the configuration.
class ActionReadFile(Action): def name(self): return “action_Read_File”
def run(self, dispatcher, tracker, domain):
try:
with open("config_mysql.json", "r") as jsonfile:
config_data = json.load(jsonfile) # Reading the file
print("Read successful")
jsonfile.close()
data=config_data["dev"]
The folder structure:
opt/RasaBot/actions/action_Read_File.py opt/RasaBot/config_mysql.json
But I am getting [Errno 2] No such file or directory: ‘opt/ChatBot/config_mysql.json’
In command prompt : The current directory is opt/RasaBot
Could you help anyone How to overcome this issue