Can Rasa X Chatbot run Python Scripts or OS Commands?

386 views Asked by At

I installed the Rasa X Chatbot on a Ubuntu system to have an chatbot in a webinterface. Now, I can set all Answers that the Rasa X Bot gives. But how can I train Rasa, so that he executes OS Commands.

I want an example dialog like this:

User: "Hey can you make an directory for me called MyDir?" Bot: "Directory 'MyDir' was successfully created"

In the background the bot has to execute an unix command like "mkdir MyDir". How / Where can I program this stuff? On the webinterface I can only add some responses in textform, but I can't tell the bot that he has to execute os commands or like call some python scripts that execute these os commands.

1

There are 1 answers

0
tabergma On BEST ANSWER

In order for your chatbot to execute custom code, you would need to create some custom actions. To run those you need to have a Rasa Action Server set up. Also your chatbot needs to know when to call those custom actions. To achieve that you need to add some training data that show when the chatbot should perform those actions.

I also recommend watching the Rasa Masterclass. It also covers how to set up custom actions and how to run those in Rasa X.