Custom action not working

Hi,

I am trying to run one custom action which is provided default in rasa x. It’s just a hello world. When I am trying to run it i am not getting any response. I have checked in Rasa community and found that this can be something related to endpoints.yml file. I am providing all the files here.

Endpoints.yml: -
# This file contains the different endpoints your bot can use.

# Server where the models are pulled from.
# https://rasa.com/docs/rasa/user-guide/running-the-server/#fetching-models-from-a-server/

#models:
#  url: http://my-server.com/models/default_core@latest
#  wait_time_between_pulls:  10   # [optional](default: 100)

#Server which runs your custom actions.
#https://rasa.com/docs/rasa/core/actions/#custom-actions/

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

# Tracker store which is used to store the conversations.
# By default the conversations are stored in memory.
# https://rasa.com/docs/rasa/api/tracker-stores/

#tracker_store:
#    type: redis
#    url: <host of the redis instance, e.g. localhost>
#    port: <port of your redis instance, usually 6379>
#    db: <number of your database within redis, e.g. 0>
#    password: <password used for authentication>

#tracker_store:
#    type: mongod
#    url: <url to your mongo instance, e.g. mongodb://localhost:27017>
#    db: <name of the db within your mongo instance, e.g. rasa>
#    username: <username used for authentication>
#    password: <password used for authentication>

# Event broker which all conversation events should be streamed to.
# https://rasa.com/docs/rasa/api/event-brokers/

#event_broker:
#  url: localhost
#  username: username
#  password: password
#  queue: queue

Actions.py
# This files contains your custom actions which can be used to run
# custom Python code.
#
# See this guide on how to implement these action:
# https://rasa.com/docs/rasa/core/actions/#custom-actions/


# This is a simple example for a custom action which utters "Hello World!"

 from typing import Any, Text, Dict, List

 from rasa_sdk import Action, Tracker
 from rasa_sdk.executor import CollectingDispatcher


 class ActionHelloWorld(Action):

     def name(self) -> Text:
         return "action_hello_world"

     def run(self, dispatcher: CollectingDispatcher,
             tracker: Tracker,
             domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:

         dispatcher.utter_message("Hello World!")

         return []

Can anyone look into this and help

Regards, Ankit Singh

Hi @AnkitSingh21, can you try uncommenting your action endpoint, so that it’s

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

and make sure to first run your action server with rasa run actions?

Hi,

Works absolutely fine. Thanks :slight_smile:

do we have to past custom action in endpoint.yml ?