Hello everyone, Recently we have started using RASA in our class for a project, therefore I am very new to RASA. I am trying to build a bot and I created a custom action called “action_sort_user” that randomly sorts the user in one of the four hogwarts houses. However, I am getting the following error:
Traceback (most recent call last):
File "C:\Users\mahaa\Anaconda3\envs\masters\lib\site-packages\rasa\core\actions\action.py", line 742, in run
response: Any = await self.action_endpoint.request(
File "C:\Users\mahaa\Anaconda3\envs\masters\lib\site-packages\rasa\utils\endpoints.py", line 173, in request
raise ClientResponseError(
rasa.utils.endpoints.ClientResponseError: 404, Not Found, body='b'{"error":"No registered action found for name \'action_sort_user\'.","action_name":"action_sort_user"}''
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\mahaa\Anaconda3\envs\masters\lib\site-packages\rasa\core\processor.py", line 869, in _run_action
events = await action.run(
File "C:\Users\mahaa\Anaconda3\envs\masters\lib\site-packages\rasa\core\actions\action.py", line 766, in run
raise RasaException("Failed to execute custom action.") from e
rasa.shared.exceptions.RasaException: Failed to execute custom action.
when running the action server with the command:
rasa run actions -vv
I see the following log:
2022-04-18 15:15:00 INFO rasa_sdk.endpoint - Starting action endpoint server...
2022-04-18 15:15:00 INFO rasa_sdk.endpoint - Action endpoint is up and running on http://0.0.0.0:5055
2022-04-18 15:15:00 DEBUG rasa_sdk.utils - Using the default number of Sanic workers (1).
2022-04-18 15:16:50 DEBUG rasa_sdk.executor - Received request to run 'action_sort_user'
2022-04-18 15:16:50 ERROR rasa_sdk.endpoint - No registered action found for name 'action_sort_user'.
I have read the documentation and followed the instructions accordingly. My actions.py contains the following code:
from typing import Text, Dict, Any, List
from rasa_sdk import Action, Tracker
from rasa_sdk.events import SlotSet
from rasa_sdk.executor import CollectingDispatcher
import pandas as pd
import random
import csv
class ActionSortUser(Action):
houses = [("gryffindor", "where dwell the brave, courageous and chivalrous at heart"),
("ravenclaw", "who are know for their intelligence, wisdom and wit"),
("hufflepuff", "who value hardwork, dedication, patience and loyality"),
("slytherin", "where roam the cunning, ambitious, resourceful people")]
def name(self) -> Text:
return "action_sort_user"
def run(self,
dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
# select a random house from the houses
house = random.choice(self.houses)
# print the house to the dispatcher
dispatcher.utter_message(text=f"I will sort you into {house[0]}, {house[1]}")
return []
I have specified the action in the domain.yml file:
actions:
- action_sort_user
In the stories.yml file the relevant code is:
- story: sort me to a house 1
steps:
- intent: greet
- action: utter_greet
- intent: sort
- action: action_sort_user
- action: utter_did_that_help
- or:
- intent: affirm
- intent: thanks
- action: utter_happy
I have also uncommented the following line in the endpoints.yml file:
action_endpoint:
url: "http://localhost:5055/webhook"
I have been trying to figure this out for a while with no avail. I would really appreciate if anyone could point me to the right direction, my deadline is approaching soon