notice

This is unreleased documentation for Rasa Documentation Main/Unreleased version.
For the latest released documentation, see the latest version (3.x).

Version: Main/Unreleased

rasa.validator

Validator Objects

class Validator()

A class used to verify usage of intents and utterances.

__init__

def __init__(domain: Domain, intents: TrainingData, story_graph: StoryGraph,
config: Optional[Dict[Text, Any]]) -> None

Initializes the Validator object.

Arguments:

  • domain - The domain.
  • intents - Training data.
  • story_graph - The story graph.
  • config - The configuration.

from_importer

@classmethod
def from_importer(cls, importer: TrainingDataImporter) -> "Validator"

Create an instance from the domain, nlu and story files.

verify_intents

def verify_intents(ignore_warnings: bool = True) -> bool

Compares list of intents in domain with intents in NLU training data.

verify_example_repetition_in_intents

def verify_example_repetition_in_intents(ignore_warnings: bool = True) -> bool

Checks if there is no duplicated example in different intents.

verify_intents_in_stories

def verify_intents_in_stories(ignore_warnings: bool = True) -> bool

Checks intents used in stories.

Verifies if the intents used in the stories are valid, and whether all valid intents are used in the stories.

verify_utterances_in_stories

def verify_utterances_in_stories(ignore_warnings: bool = True) -> bool

Verifies usage of utterances in stories.

Checks whether utterances used in the stories are valid, and whether all valid utterances are used in stories.

verify_forms_in_stories_rules

def verify_forms_in_stories_rules() -> bool

Verifies that forms referenced in active_loop directives are present.

verify_actions_in_stories_rules

def verify_actions_in_stories_rules() -> bool

Verifies that actions used in stories and rules are present in the domain.

verify_story_structure

def verify_story_structure(ignore_warnings: bool = True,
max_history: Optional[int] = None) -> bool

Verifies that the bot behaviour in stories is deterministic.

Arguments:

  • ignore_warnings - When True, return True even if conflicts were found.
  • max_history - Maximal number of events to take into account for conflict identification.

Returns:

False is a conflict was found and ignore_warnings is False. True otherwise.

verify_nlu

def verify_nlu(ignore_warnings: bool = True) -> bool

Runs all the validations on intents and utterances.

verify_form_slots

def verify_form_slots() -> bool

Verifies that form slots match the slot mappings in domain.

verify_slot_mappings

def verify_slot_mappings() -> bool

Verifies that slot mappings match forms.

verify_domain_validity

def verify_domain_validity() -> bool

Checks whether the domain returned by the importer is empty.

An empty domain or one that uses deprecated Mapping Policy is invalid.

warn_if_config_mandatory_keys_are_not_set

def warn_if_config_mandatory_keys_are_not_set() -> None

Raises a warning if mandatory keys are not present in the config.

Additionally, raises a UserWarning if the assistant_id key is filled with the default placeholder value.