rasa/core/training/dsl.py
def _parameters_from_json_string(s: Text, line: Text) -> Dict[Text, Any]:
        """Parse the passed string as json and create a parameter dict."""

        if s is None or not s.strip():
            # if there is no strings there are not going to be any parameters
            return {}

        try:
            parsed_slots = json.loads(s)
            if isinstance(parsed_slots, dict):
                return parsed_slots
            else:
                raise Exception("Parsed value isn't a json object "
                                "(instead parser found '{}')"
                                ".".format(type(parsed_slots)))
        except Exception as e:
            raise ValueError("Invalid to parse arguments in line "
                             "'{}'. Failed to decode parameters"
                             "as a json object. Make sure the event"
                             "name is followed by a proper json "
                             "object. Error: {}".format(line, e))
Parse the passed string as json and create a parameter dict.
Parse the passed string as json and create a parameter dict.
Parse the passed string as json and create a parameter dict .
def _parameters_from_json_string(s: Text, line: Text) -> Dict[Text, Any]:
        if s is None or not s.strip():
            return {}
        try:
            parsed_slots = json.loads(s)
            if isinstance(parsed_slots, dict):
                return parsed_slots
            else:
                raise Exception("Parsed value isn't a json object "
                                "(instead parser found '{}')"
                                ".".format(type(parsed_slots)))
        except Exception as e:
            raise ValueError("Invalid to parse arguments in line "
                             "'{}'. Failed to decode parameters"
                             "as a json object. Make sure the event"
                             "name is followed by a proper json "
                             "object. Error: {}".format(line, e))
def _parameters_from_json_string ( s : Text , line : Text ) -> Dict [ Text , Any ] : if s is None or not s . strip ( ) : return { } try : parsed_slots = json . loads ( s ) if isinstance ( parsed_slots , dict ) : return parsed_slots else : raise Exception ( "Parsed value isn't a json object " "(instead parser found '{}')" "." . format ( type ( parsed_slots ) ) ) except Exception as e : raise ValueError ( "Invalid to parse arguments in line " "'{}'. Failed to decode parameters" "as a json object. Make sure the event" "name is followed by a proper json " "object. Error: {}" . format ( line , e ) )
Parse the passed string as json and create a parameter dict.
Parse the passed string as json and create a parameter dict .
"""Parse the passed string as json and create a parameter dict.""" # if there is no strings there are not going to be any parameters
s
Text
line
Text