How to solve actions in rasa x and work?

hey my action.py is from rasa_core.actions import Action

class ActionOrderPizza(Action): def name(self): return ‘action_order_pizza’ def run(self): print(‘Ordering Pizza is completed! It should be with you soon :)’) pass when I would run action the issue I receive :

Encountered an exception while running action ‘action_order_pizza’. Bot will continue, but the actions events are lost. Make sure to fix the exception in your custom code.

You have to check the terminal where you’re running your action server to see the exception that was thrown. That will help you find it.

yes I did it I run my action on terminal rasa run actions it works but when I go back to see how it work by taping rasa shell not workıng at all

and also that action not working

def name(self):

 return "action_question_mark"

def run(self, dispatcher, tracker, domain):

message = tracker.latest_message.text["text"]
# dispatcher.utter_message("Hello World!")
if message.endswith("?"):
# Return a random question
    return dispatcher.utter_message("Question")
else:
    return dispatcher.utter_message("statement")

Right, but when you get the error

Encountered an exception while running action ‘action_order_pizza’. Bot will continue, but the actions events are lost. Make sure to fix the exception in your custom code.

Do you also get an error in the other terminal window?

sorry I did not get your idea can you explain more plz

When you ran the bot, in one terminal window, you ran rasa run actions. In the other you ran rasa shell. If you get that error in your rasa shell window, you have to look for the real error in the rasa run actions window.

yes totally ı agree with you I opened two windows one for actions and the other for working in details but error that I received it for the window in acton server

So the error in the action server window will have information about what went wrong in your actions.py file.