notice

This is unreleased documentation for Rasa Open Source Documentation Master/Unreleased version.
For the latest released documentation, see the latest version (2.8.x).

Version: Master/Unreleased

rasa.shared.core.training_data.story_reader.story_reader

StoryReader Objects

class StoryReader()

Helper class to read a story file.

__init__

def __init__(domain: Optional[Domain] = None, source_name: Optional[Text] = None) -> None

Constructor for the StoryReader.

Arguments:

  • domain - Domain object.
  • source_name - Name of the training data source.

read_from_file

def read_from_file(filename: Text, skip_validation: bool = False) -> List[StoryStep]

Reads stories or rules from file.

Arguments:

  • filename - Path to the story/rule file.
  • skip_validation - True if file validation should be skipped.

Returns:

StorySteps read from filename.

is_stories_file

@staticmethod
def is_stories_file(filename: Union[Text, Path]) -> bool

Checks if the specified file is a story file.

Arguments:

  • filename - File to check.

Returns:

True if specified file is a story file, False otherwise.

StoryParseError Objects

class StoryParseError(RasaCoreException, ValueError)

Raised if there is an error while parsing a story file.