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.shared.core.training_data.story_writer.story_writer

StoryWriter Objects

class StoryWriter()

Writes story training data to file.

dumps

def dumps(story_steps: List["StoryStep"],
is_appendable: bool = False,
is_test_story: bool = False) -> Text

Turns Story steps into an string.

Arguments:

  • story_steps - Original story steps to be converted to the YAML.
  • is_appendable - Specify if result should not contain high level keys/definitions and can be appended to the existing story file.
  • is_test_story - Identifies if the stories should be exported in test stories format.

Returns:

String with story steps in the desired format.

dump

def dump(target: Union[Text, Path, yaml.StringIO],
story_steps: List["StoryStep"],
is_appendable: bool = False,
is_test_story: bool = False) -> None

Writes Story steps into a target file/stream.

Arguments:

  • target - name of the target file/stream to write the string to.
  • story_steps - Original story steps to be converted to the string.
  • is_appendable - Specify if result should not contain high level keys/definitions and can be appended to the existing story file.
  • is_test_story - Identifies if the stories should be exported in test stories format.