How to Reactivate forms in Rasa 3.1?

Hi Team, I am trying to implement two usecases where I am taking user input via forms & slots implementation and then validate user input via custom action. After validating I am trying to pull the information from python API via custom action. I have implemented flow in rules rather in stories for these usecases as per rasa documentation. It works as expected when I first time call the intent , it asks for user input and sets the slots but when next time in same session if I call same intent I get previous response, It doesn’t ask for user inputs. Here are the snippet and respective files.

Chat: Your input → server information XXXX

Please proceed with server_information

Looking for server_information XXXXX

(Get the proper response)

Your input → server info

Please proceed with server_information

Looking for server_information XXXXXX // Here it should ask me to provide the server name (Get previous response)

nlu.yml:

  • intent: server_information

    examples: |

    • server xxxxxxx information

    • server xxxxxxx details

    • server xxxxxxx info

    • db server xxxxxx details

    • db server xxxxxxx info

    • db server xxxxxx](server_name) information

    • database xxxxxx](server_name) server information

    • database xxxxxxx server details

    • database server info

    • pega server information

    • pega server info

    • pega server details

    • ebiz server information

    • ebiz server info

    • ebiz server details

    • jboss server information

    • jboss server info

    • jboss server details

  • intent: database_information

    examples: |

    • database xxxxxx information

    • database xxxx details

    • database xxxx info

    • db xxxxx details

    • db xxxx info

    • db xxxx information

    • db info

    • db details

    • db information

    • database information

    • database info

    • database details

rules.yml:

  • rule: Activate ServerInformation form

    steps:

    • intent: server_information

    • action: server_information_form

    • active_loop: server_information_form

  • rule: Submit ServerInformation form

    condition:

    • active_loop: server_information_form

    steps:

    • action: server_information_form

    • active_loop: null

    • slot_was_set:

      • requested_slot: null
    • action: utter_submit

    • action: utter_slots_values

    • action: action_server_information

  • rule: Activate DatabaseInformation form

    steps:

    • intent: database_information

    • action: database_information_form

    • active_loop: database_information_form

  • rule: Submit databaseInformation form

    condition:

    • active_loop: database_information_form

    steps:

    • action: database_information_form

    • active_loop: null

    • slot_was_set:

      • requested_slot: null
    • action: utter_submit_database

    • action: utter_slots_values_database

    • action: action_database_information

domain.yml:

version: ‘3.1’

intents:

  • affirm

  • bot_challenge

  • database_information

  • deny

  • goodbye

  • greet

  • mood_great

  • mood_unhappy

  • server_information

entities:

  • server_name

  • database

slots:

server_name:

type: text

#influence_conversation: true

mappings:

- type: from_entity

  entity: server_name

database:

type: text

#influence_conversation: true

mappings:

- type: from_entity

  entity: database    

forms:

server_information_form:

required_slots:

- server_name

database_information_form:

required_slots:

- database  

responses:

utter_greet:

  • text: Hey! How are you?

utter_cheer_up:

utter_did_that_help:

  • text: Did that help you?

utter_happy:

  • text: Great, carry on!

utter_goodbye:

  • text: Bye

utter_iamabot:

  • text: I am a bot, powered by Rasa.

utter_submit:

  • text: Please proceed with server_information

utter_slots_values:

  • text: Looking for server_information {server_name}

utter_submit_database:

  • text: Please proceed with database_information

utter_slots_values_database:

  • text: Looking for database_information {database}

utter_ask_server_information_form_server_name:

  • text: Please provide Server Name

utter_ask_database_information_form_database:

  • text: Please provide Database Name

actions:

  • action_database_information

  • validate_server_information_form

  • validate_database_information_form

  • action_server_information

session_config:

session_expiration_time: 60

carry_over_slots_to_new_session: true

config.yml (1.5 KB)

Please suggest if this is normal behavior of rasa or something is missing.

I resolved this issue by below implementation in actions implementation.

       if not tracker.slots["requested_slot"] == "server_name" :
          return {"server_name": None}
        else:    
          return {"server_name": tracker.get_slot('server_name')}