How predict action from action.py file

how call a action in action.py file

You may want to have a look at this https://rasa.com/docs/rasa/core/actions/#custom-actions-written-in-python if you are looking for how to write python code in an action file. I guess this is what you are looking for based on your quite short explanation.

If you have problems running the action.py in your rasa x environment, please do not forget to run your action server. Have a look at this quote from above website.

If you have rasa installed, run this command to start your action server:

rasa run actions

Otherwise, if you do not have rasa installed, run this command:

python -m rasa_sdk --actions actions

i am asking that i have a hotel booking chatbot so if user enter "Book hotel in india for tomorrow " then i want to perform both action like action_save_location and action_save_date. all right but when i apply validation on action_save_location(where you want to go in india) then next action it ask date also. so i wnat to perform bot action same time location validation and save_date . how call a action from action.py file ???

How did you define your slots and actions within the domain.yml? Also, how did you write your story?

my story look like ;

Generated Story -9123541417746865941

  • hotel.book
    • utter_location
  • hotel.book{“location”: “surat”}
    • slot{“location”: “surat”}
    • action_save_location_hotel
    • slot{“location”: “surat”}
    • slot{“venue-facility”: null}
    • slot{“map-sort”: null}
    • slot{“filter-value_stack”: null}
    • utter_date
  • hotel.book{“DATE”: “september 12”, “date”: “september 12”, “distance”: 12.0, “volume”: 12.0, “temperature”: 12.0, “time”: “2019-09-12T00:00:00.000Z”}
    • action_save_data_hotel
    • slot{“date_hotel”: “2019-09-12”}
    • action_search_hotel
    • slot{“checkout-date”: null}
    • export

this is my “action_save_location” method return return [SlotSet(‘location’, location)] and this is my “action_save_date” method return return [SlotSet(‘date_hotel’, date_hotel)]

But my be user can type “i want to book hotel in India(country) for 5 july” but also i have validation on action_save_location that (ask user where you want to go in india)