Can’t get form to deactivate

When I use the following command to start rasa…

rasa run -m models --enable-api --cors “*”

everything loads and then it gives the following message: The client is using an unsupported version of the Socket.IO or Engine.IO protocols (further occurrences of this error will be logged with level INFO)

I spent two days trying to get this issue worked out, but had no success. Everything in the forum spoke of a socketio version mismatch with the rasa-webchat but nothing was clear in the way of how to solve it. The only thing that worked was downgrading back to versions 2.0

I literally tried every variation of python-socketio and python-engineio. It became a source of consternation.

And this is the rasa-webchat widget code…

index.html (1005 Bytes)

I think it’s liked to this…

@eaofcc Ok

What’s wrong with the rasa-webchat code? It works for Rasa 2.0 rasa_sdk 2.0. In fact, I was just able to get Rasa 2.3 and rasa_sdk 2.3.1 to work with it as well.

@eaofcc You are able to run on localhost? or can see chat widget? able to get response?

Yes. On http://localhost:8000 and I’m able to use the chat widget with no problem. Everything works, so long as I don’t exceed rasa 2.3 and rasa_sdk 2.3.1 :slight_smile:

@eaofcc are you validating any form? I guess no right. then me bad Sorry. I withdraw my post. I think I need break today :frowning: @eaofcc your issue in mind that’s why thinking…sorry for the confusion.

Not sure. Good question. :slight_smile: Would FormValidationAction do something different? All the examples I saw when learning how to do forms used Action, so that’s what I went with. No other reason.

It’s ok. No worries. :slight_smile: Things will get figured out. I’ll keep trying different things as well. Take care and thanks!

Ok I’m faced with one of two choices. First would be to solve the problem of not being able to deactivate a form. This has proven to be borderline impossible in Rasa 2.3 or lower. The second choice would be to upgrade to Rase 2.7 and rasa_sdk 2.7, which I’m able to do. HOWEVER, when I do that, the rasa-webchat stops working. Another known problem that there seems to be no workable solution for. I keep hearing about changing socketio and then there’s the “It’s an issue with rasa-webchat socketio version”. Either way, after having tried a near infinite amount of things, I can’t get Rasa 2.7 and rasa_sdk 2.7 to connect with rasa_webchat. All I get is the Client socketio error when I run the following command… rasa run -m models --enable-api --cors “*”

I’ll start a new thread requesting help for the socketio issue. Hopefully there’s a solution.

@eaofcc please share your email id please. I would like to help you online :slight_smile: If you want. Please mention me, in your next post. Thanks.

@eaofcc Just update the rasa version and you will be able to deactivate, hope so else buzz me back :slight_smile:

1 Like

Ok, special thanks to @nik202 for helping me to get through all of this. While I’ve seen a lot of posts regarding form deactivation, I’ve never seen one solution that consistently worked. I think that maybe I’ve found that solution. If so, hopefully this will help everyone out there who is struggling with form deactivations. Note: This example is SUPER simple. And while I’m actually on Rasa 2.8 (rasa_sdk 2.8) it should be backwards compatible. Below I’ll list the example by files (nlu.yml, domain.yml, rules.yml and actions.py). For the actions, I only listed the custom action that stops the form - to keep things simple. Again, this is the only solution that I’ve been successful with each time.

The form has 3 slots: company_location, company_name and company_source. If a user wants to exit the form they type ‘halt’, which is associated with the stop_company_form intent. This prompts the execution of the action_stop_company_form custom action, which deactivates the form and clears all the slots.

#nlu.yml ##################

nlu:
- intent: stop_company_form
  examples: |
    - halt
    - halt halt
    - I'm halting
    - halt halt halt

- intent: create_company
  examples: |	
    - i want to create a company
    - let's setup a company
    - add company


#domain.yml ##################

intents:
- stop_company_form:
	use_entities: []
- create_company:
	use_entities: []

slots:
  company_location:
    type: text
    auto_fill: false
    influence_conversation: false
  company_name:
    type: text
    auto_fill: false
    influence_conversation: false
  company_source:
    type: text
    auto_fill: false
    influence_conversation: false

actions:
- action_submit_company
- action_stop_company_form

forms:
  company_form:
    ignored_intents:
    - stop_company_form
    required_slots:
        company_location:
        - type: from_text
        company_name:
          type: from_text
        company_source:
        - type: from_text

#rules.yml ##################
rules:
- rule: Activate Company Form
  steps:
  - intent: create_company
  - action: company_form
  - active_loop: company_form

- rule: Stop Company Form
  steps:
  - intent: stop_form
  - action: action_stop_company_form
  - action: action_deactivate_form #deactivates form
  - active_loop: null #kills loop


#actions.py ##################
class StopCompanyForm(Action):
    def name(self) -> Text:
        return "action_stop_company_form"

    def run(
        self,
        dispatcher: CollectingDispatcher,
        tracker: Tracker,
        domain: Dict[Text, Any],
    ) -> List[Dict[Text, Any]]:

    	#Utters message to inform user form has been cancelled
        dispatcher.utter_message(text="Company Form Canceled!")

        #Clears slots
        return[SlotSet(SlotSet("company_location", None),SlotSet("company_name", None),SlotSet("company_source", None)]
1 Like

@eaofcc congratulations :bouquet::clap::clap:

1 Like

Thanks! You’re the reason I was able to figure this out. Thx!

1 Like

@eaofcc :relaxed::relaxed::relaxed: :handshake: anytime bro.

1 Like