docstr: Add a checkpoint to story steps.
docstr_tok: ["Add","a","checkpoint","to","story","steps","."]
code: def add_checkpoint(
      self, name: Text, conditions: Optional[Dict[Text, Any]]
  ) -> None:
      """Add a checkpoint to story steps."""
      # Depending on the state of the story part this
      # is either a start or an end check point
      if not self.current_steps:
          self.start_checkpoints.append(Checkpoint(name, conditions))
      else:
          if conditions:
              rasa.shared.utils.io.raise_warning(
                  f"End or intermediate checkpoints "
                  f"do not support conditions! "
                  f"(checkpoint: {name})",
                  docs=DOCS_URL_STORIES + "#checkpoints",
              )
          additional_steps = []
          for t in self.current_steps:
              if t.end_checkpoints:
                  tcp = t.create_copy(use_new_id=True)
                  tcp.end_checkpoints = [Checkpoint(name)]
                  additional_steps.append(tcp)
              else:
                  t.end_checkpoints = [Checkpoint(name)]
          self.current_steps.extend(additional_steps)
  
file_path: rasa/rasa/shared/core/training_data/story_reader/story_step_builder.py
imports: import logging
  from typing import Text, Optional, Dict, Any, List
  import rasa.shared.core.training_data.structures
  import rasa.shared.utils.io
  from rasa.shared.constants import DOCS_URL_STORIES
  from rasa.shared.core.events import UserUttered, Event
  from rasa.shared.core.training_data.structures import Checkpoint, GENERATED_CHECKPOINT_PREFIX, GENERATED_HASH_LENGTH, STORY_START, StoryStep, RuleStep
label_desc: Use image node_id 2 for calling the StoryStepBuilder obj's underlying member method code with example usage: obj.add_checkpoint(name, conditions) without return types