Implementing Custom Actions with Python Rasa_core 0.11.1

Having trouble getting my custom actions up and running and I’m not sure they are being recognized by the bot.

The migration guide states for rasa_core 0.11.1, there have been changes in how to implement custom action.

  • If you have custom actions, you now need to run a separate server to execute them. If your actions are written in python (in a file called actions.py) you can do this by running python -m rasa_core_sdk.endpoint --actions actions and specifying the action endpoint in the endpoints.yml

I have written a actions.py script with a custom action, and added an endpoint.yml file with the an endpoint.

endpoints.yml

action_endpoint: url: http://localhost:5055/webhook

Now, the docs say to run the command;

python -m rasa_core_sdk.endpoint --actions actions

Now the action server endpoint is started and my actions are registered ;

(test) Ahson:chatbot-master ahson$ INFO:main:Starting action endpoint server… INFO:rasa_core_sdk.executor:Registered function for ‘action_user_Auth’. INFO:rasa_core_sdk.executor:Registered function for ‘action_saveSomething’. INFO:main:Action endpoint is up and running. on (‘0.0.0.0’, 5055)

How do I start interacting with my bot now? If I run (command below) how do I make sure its interacting with the same server?

python -m rasa_core.run -d models/dialogue -u models/current/nlu

I made a simple test action to see if I could get read user input and utter it back to the user.

actions.py;

from rasa_core_sdk import Action
from rasa_core_sdk.events import SlotSet

class ActionSaveSlot(Action):
    def name(self):
        return 'action_saveSomething'


    def run(self, dispatcher, tracker, domain):
        response =  tracker.latest_message.text
        dispatcher.utter_message(response)
        return [SlotSet("answers", tracker.latest_message.text)]

stories.md

##user_info

  • utter_request_info
  • user_info{“answer”:“username”}
  • action_saveSomething

Would be very grateful for any help/assistance!

issue resolved; Needed to include both action and core endpoints in endpoints.yml

action_endpoint: url: http://localhost:5055/webhook

core_endpoint: url: http://localhost:5005