Checks whether the domain returned by the importer is empty. An empty domain or one that uses deprecated Mapping Policy is invalid.
(self)
| 396 | return everything_is_alright |
| 397 | |
| 398 | def verify_domain_validity(self) -> bool: |
| 399 | """Checks whether the domain returned by the importer is empty. |
| 400 | |
| 401 | An empty domain or one that uses deprecated Mapping Policy is invalid. |
| 402 | """ |
| 403 | if self.domain.is_empty(): |
| 404 | return False |
| 405 | |
| 406 | for intent_key, intent_dict in self.domain.intent_properties.items(): |
| 407 | if "triggers" in intent_dict: |
| 408 | rasa.shared.utils.io.raise_warning( |
| 409 | f"The intent {intent_key} in the domain file " |
| 410 | f"is using the MappingPolicy format " |
| 411 | f"which has now been deprecated. " |
| 412 | f"Please migrate to RulePolicy." |
| 413 | ) |
| 414 | return False |
| 415 | |
| 416 | return True |
| 417 | |
| 418 | def warn_if_config_mandatory_keys_are_not_set(self) -> None: |
| 419 | """Raises a warning if mandatory keys are not present in the config. |