Action not getting registered in rasa core


I am trying to run a custom action but the action is not getting registered when starting action server. Here is the file.

from future import absolute_import from future import division from future import print_function from future import unicode_literals

from rasa_sdk import Tracker from rasa_core.actions.action import Action from rasa_sdk.executor import CollectingDispatcher from pymongo import MongoClient

import logging import requests import urllib.request import json from rasa_sdk.executor import CollectingDispatcher from rasa_sdk.forms import FormAction, REQUESTED_SLOT from import SlotSet, UserUtteranceReverted,

#logger = logging.getLogger(name) logging.Logger(name) class Person(Action):

def name(self):
	return 'action_greet'
def __init__(self,employee_id,employee_name):
	self.employee_id = employee_id
	self.employee_name = employee_name

def __str__(self):
	return (f'employee_name: {self.employee_name}',
			f'employee_id: {self.employee_id}')

def run(self, dispatcher, tracker, domain):
	employee_name = next(tracker.get_latest_entity_values('employee_name'), None)
	dispatcher.utter_message("Nice to meet you "+ employee_name+ " How can i help you")
	return [SlotSet("employee_name", employee_name)]

def read(employee_id: int) -> Person:

myclient = pymongo.MongoClient("xxxxx")
mydb = myclient["xxxxx"]
mycol = mydb["xxxxx"]
cursor = db.cursor()
query = db.mycol.findOne({'employee_id': employee_id})

query = db.mycol.find_one({‘employee_id’: employee_id })

	results = cursor.fetchall()
	for row in results:
		employee_id = row[1]
		employee_name = row[2]

		person = Person(employee_id,employee_name)
	print("Error fetching data.")

return person

I have already added my action in domain and stories file. Could anyone please help me.

Cheers, Ankit

This is a wrong import.

Please try from rasa_sdk.interfaces import Action