Rasa Open Source 2.0 is out now!

@petasis

@Tobias_Wochinger Here it is:

The event order is for some reason wrong. The flight_departure_form should come before the slot events. I just tried this out myself and the order is definitely correct. How does your domain look like and which versions of Rasa Open Source and the Rasa SDK are you using?

the form slots that should be filled according to the domain file, were filled before a form validation was requested. In rasa 2.0, the form slots are empty. And when validation is asked from the action server, now the slot filling has to somehow happen in the actions server.

The slots should still be filled based on the slot mappings before the request is sent to the SDK. The SDK can 1) validate the extracted slots 2) Add new slot events (e.g. for custom slot mappings)

I am using rasa/sdk 2.0. In rasa 2.0.0rc4 I had a workarround. In rasa 2.0 I don’t know what to do. The domain is included in the archive.

When you mention the “The flight_departure_form should come before the slot events”, in which file you are referring to? Can you send me a “corrected” story? (I generated the stories with rasa interactive).

rasa --version
Rasa Version     : 2.0.0
Rasa SDK Version : 2.0.0
Rasa X Version   : None
Python Version   : 3.8.5 (default, Aug 12 2020, 00:00:00) 
Operating System : Linux-5.8.12-200.fc32.x86_64-x86_64-with-glibc2.2.5
Python Path      : /usr/bin/python3

Regarding running the form, no, no form slots are filled before calling the form activation/validation.

That part should be done within Rasa Open Source so you don’t require a story for that.

The domain is included in the archive.

Sorry, but where can I find this archive? :see_no_evil:

Has Rasa X been updated to work with Rasa 2.0? I don’t see a new tag in docker hub: Docker Hub

Hi @tatianaf, thanks for asking! We’ll release a compatible version end of this week / early next week :+1:

I have created a small example, uploaded here: Rasa 2.0: How to resolve conflicting rules?

Some observations from the upgrade to Rasa 2.0.

Rasa 2.0 installs tensorflow 2.3.1. which has specific environment requirements before it can utilize a GPU. Requirements listed here:

For reference my working environment is:

  • GPU: GeForce GTX1070 (must be an approved GPU. see CUDA GPUs | NVIDIA Developer)
  • GPU driver - 456.38 (latest will probably work)
  • CUDA toolkit - 10.1.243 (must be 10.1 version)
  • cuDNN - 7.6.5 (must be 7.6 version)

It is possible to make TF work with other version combinations but this will require a recompile of the toolkit.

When a new version with working forms will be released? It was been a week since the release of 2.0.

1 Like

Facing almost the same problem :confused: . Slots gets extracted but does not get validated using validate_<slot_name> function.

@petasis are you able to validate the slot filled when asked explicitly rather than in the trigger message? if yes can you share how did you do that. Thanks

Yes, I know :slight_smile: It makes rasa 2.0 unusable, doesn’t it? It is surprising that it got released in the first place, and that a week without a fix has passed.

Yes totally agree, Form is an important feature. Also i was checking their implementation. required_slots and validate functions are still there then why are they providing a new interface. I was overriding validate before, without any issue :confused: . I am also stucked :confused:

Yes, I think this is working. The problem is when the value to fill the slot is in the trigger message. I haven’t done anything special, I just followed the docs here:

(If you had your actions working according to 2.0.0rc4, you need to change them again).

1 Like

@noman you’re right that those functions still exist (they just read from different sources now), the idea behind moving e.g. the required_slots definition to the domain is to make it simpler to define a form - i.e. less code. And aside from that moving the logic of the FormAction to Rasa Open Source, means that creating action servers in different languages is a lot easier. You can also hear more about this in our 2.0 webinar today

@akelad so can we override validate even now? if yes, then why i should not override it? because current guidelines here Forms does not validate filled slots having logs

`2020-10-14 17:06:20 DEBUG rasa.core.processor - Logged UserUtterance - tracker now has 297 events. 2020-10-14 17:06:20 DEBUG rasa.core.policies.rule_policy - Predicted loop ‘order_form’. 2020-10-14 17:06:20 DEBUG rasa.core.policies.ensemble - Predicted next action using policy_0_RulePolicy 2020-10-14 17:06:20 DEBUG rasa.core.processor - Predicted next action ‘order_form’ with confidence 1.00. 2020-10-14 17:06:20 DEBUG rasa.core.actions.forms - Validating user input ‘UserUttered(text: lays, intent: {‘id’: 3152659454284902011, ‘name’: ‘inform’, ‘confidence’: 0.999991774559021}, entities: [{‘entity’: ‘snack’, ‘start’: 0, ‘end’: 4, ‘confidence_entity’: 0.8661425709724426, ‘value’: ‘lays’, ‘extractor’: ‘DIETClassifier’}])’. 2020-10-14 17:06:20 DEBUG rasa.core.actions.forms - Trying to extract requested slot ‘snack’ … 2020-10-14 17:06:20 DEBUG rasa.core.actions.forms - Got mapping ‘{‘type’: ‘from_entity’, ‘entity’: ‘snack’}’ 2020-10-14 17:06:20 DEBUG rasa.core.actions.forms - Successfully extracted ‘lays’ for requested slot ‘snack’ 2020-10-14 17:06:20 DEBUG rasa.core.actions.forms - Validating extracted slots: {‘snack’: ‘lays’} 2020-10-14 17:06:20 DEBUG rasa.core.actions.action - Calling action endpoint to run action ‘validate_order_form’. 2020-10-14 17:06:20 DEBUG rasa.core.actions.forms - Request next slot ‘size’

and My custom action: from typing import Dict, Text, List

from rasa_sdk import Tracker from rasa_sdk.events import EventType from rasa_sdk.executor import CollectingDispatcher from rasa_sdk import Action from rasa_sdk.events import SlotSet from typing import Text, List, Any, Dict from rasa_sdk import Tracker, FormValidationAction from rasa_sdk.types import DomainDict from rasa.shared.core.domain import Domain

class ActionSwitchFAQ(Action): def name(self) -> Text: return “action_switch_faq”

def run(
    self, dispatcher: CollectingDispatcher, tracker: Tracker, domain: Dict
) -> List[EventType]:
    return [SlotSet("detailed_faq", not tracker.get_slot("detailed_faq"))]

class ValidateOrderForm(FormValidationAction, Action): def name(self) -> Text: “”“Unique identifier of the form”""

    return "validate_order_form"

def run(
    self, dispatcher: CollectingDispatcher, tracker: Tracker, domain: Dict
) -> List[EventType]:
    # dispatcher.utter_message("validate_some_slot")
    return []

def validate_snack(
    self,
    slot_value: Any,
    dispatcher: CollectingDispatcher,
    tracker: Tracker,
    domain: DomainDict,
) -> Dict[Text, Any]:
    """Validate cuisine value."""
    
    print("Slot Value=", slot_value)
    if slot_value == "fries":
        print("validation succeeded")
        return {"snack": slot_value}
    else:
        print("validation failed")
        # user will be asked for the slot again
        return {"snack": None}

def validate_size(
    self,
    slot_value: Any,
    dispatcher: CollectingDispatcher,
    tracker: Tracker,
    domain: DomainDict,
) -> Dict[Text, Any]:
    """Validate cuisine value."""
    
    print("Slot Value=", slot_value)
    if slot_value == "large":
        print("validation succeeded")
        return {"size": slot_value}
    else:
        print("validation failed")
        # user will be asked for the slot again
        return {"size": None}   

`

@noman do you mind creating a new forum post and tagging me in it? would be easier to separate out various issues we’re trying to figure out

sure that would be great

Any news for a fix for the forms problem to not filling/validating slots from the utterance triggering the form?

hi, how to control or select entity extracted by multi entity extractor? I am using RegexExtracor, CRFextractor, DIETextractor to extract my entity, as a result, the tracker will keep these three extracting results as a list, so how to control the tracker just keep only one result?

This is another difficult issue. Is these slots are for a form, you can write an action to validate the slot. The validation function will get the list of values, and you can select one of them. What I did (for my case) was to remove duplicates, and from the remaining values get the one with most characters.

If you not in a form, you can write a custom action, or a custom component.

@123 could you open a new post so we can address that issue separately?

@petasis could you a post for the issue you were originally talking about with all the details you shared already? this thread has a bunch of different discussions going on, and it’s gotten a little difficult to keep track of the issue/the data you’ve shared. Same goes for the second issue you just mentioned. Feel free to tag myself and/or Tobias