User choose option by number

Hi everyone i have some issue with rasa. in my chatbot user can choose an option with a number like:
Bot: please choose you order:
1: order pizza
2: order noodle
3: order pasta
User: 1
Bot: ok you want to order pizza
this is my actions.py but the log actions server say: Failed to register package ‘actions’.

from typing import Dict, Text, Any, List, Union, Optional

from rasa_sdk.actions import Action from rasa_sdk import Tracker from rasa_sdk.executor import CollectingDispatcher from rasa_sdk.forms import FormAction

class chooseOption(Action): def name(self): return “action_choose_option”

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

    user_msg = tracker.latest_message.get('text')
    print(user_msg)

if user_msg == '1':
    response = "ok you choose pizza"

if user_msg == '2':
    response = "ok you choose noddle"

if user_msg == '3':
    response = "ok you choose pasta"

    dispatcher.utter_template("response", tracker)

my stories:

greet

  • greet
    • utter_greet
  • orderFood
    • utter_ask_action_choose_option
  • bye
    • utter_good_bye

i dont know what exactly error in my code. please help me

I suspect this happens because of the line

from rasa_sdk.actions import Action,

which should be

from rasa_sdk import Action.

If this doesn’t help, or if you have questions about errors in the future please include more of the traceback. In this case for example your probably included the lines

from rasa_sdk.actions import Action
ModuleNotFoundError: No module named 'rasa_sdk.actions'

which would have made this easier to debug :slight_smile:

oh thank you so much