I recently started trying out rasa. I am trying to build a chatbot that will filter results from a sqlite database and return it to the user when a question is asked. To do this, I wrote a custom action and specified an endpoint. I started the action_server and in a new terminal, ran the rasa shell with the endpoint specified
rasa shell --endpoints endpoints.yml
This is the code I used to run the action server
python -m rasa_sdk --actions actions
but when the question is asked to the bot, it just prompts me for the next input and returns an exception
rasa.core.processor - Encountered an exception while running action 'action_testAction'. Bot will continue, but the actions events are lost. Please check the logs of your action server for more information
In the action_server terminal window, I get the following error
Exception: No registered Action found for name 'action_testAction'.
this is my endpoint.yml file
action_endpoint:
url: "http://localhost:5055/webhook"
this is my actions.py file
from typing import Any, Text, Dict, List
from rasa_core_sdk import Action, Tracker
import sqlite3
class TestAction(Action):
def name(self) -> Text:
return "action_testAction"
def run(self, dispatcher, tracker, domain):
UserId = tracker.get_slot('UserID')
query = 'SELECT User_name FROM sales WHERE UserID=?'
conn = sqlite3.connect("test.db")
cursor = conn.cursor()
cursor.execute(query, (UserId,))
name = cursor.fetchall()
msg = 'Hello {}!'.format(name)
dispatcher.utter_message(msg)
Not sure what I am doing wrong
Please help