def maybe_inject_narrative_push(
    chain_of_thought: interactive_document.InteractiveDocument,
    putative_event: str,
    active_player_name: str,
):
  """Maybe inject some new event to push the narrative forward.

  Args:
    chain_of_thought: the document to condition on and record the thoughts
    putative_event: putative event to (maybe) add a narrrative push to
    active_player_name: name of player whose turn it currently is

  Returns:
  """
  del active_player_name
  if not chain_of_thought.yes_no_question(
      question='Is the story traced out by the above list of events repetitive?'
  ):
    return putative_event

  tmp_chain_of_thought = chain_of_thought.copy()
  plausible_events = tmp_chain_of_thought.open_question(
      question=('Suggest five plausible events or complications to the '
                'putative event being resolved that may now occur to move '
                'the narrative forward. Put each one on a separate line. '
                'Do not include titles, headings, or numbers. Just '
                'include the in-narrative description of each of the plausible '
                'events or complications. Only suggest the sort of thing that '
                'the game master of a typical tabletop role-playing game would '
                'be able to decide on their own without reducing '
                'the players\' feelings of agency or making the world feel '
                'arbitrary and unfair. '
                'In particular, never assume a player character takes '
                'a voluntary action. Non-player characters, on the other hand, '
                'can always be used to push the narrative forward since they '
                'are controlled by the game master.'
                'Eg:\nfirst plausible event\nsecond plausible event\n'
                'third plausible event\nfourth plausible event\n'
                'fifth plausible event\n'),
      max_tokens=1500,
      terminators=(),
  )
  plausible_events = plausible_events.split('\n')

  additional_plausible_event = random.choice(plausible_events)
  combined_plausible_event = (f'1. {putative_event}\n'
                              f'2. {additional_plausible_event}')

  composite_event = chain_of_thought.open_question(
      question=(f'Given:\n{combined_plausible_event}\n\nHow does 2 modify, '
                'complicate, extend, or otherwise change the meaning of 1? '
                'Answer in the form of an in-narrative compound event that '
                'incorporates both 1 and 2 into a single composite event.'),
      max_tokens=1500,
      terminators=(),
  )

  return composite_event
Maybe inject some new event to push the narrative forward.

  Args:
    chain_of_thought: the document to condition on and record the thoughts
    putative_event: putative event to (maybe) add a narrrative push to
    active_player_name: name of player whose turn it currently is

  Returns:
  
concordia/thought_chains/thought_chains.py