def add_minigame_scene_spec(
    model: language_model.LanguageModel,
    game_master_memory: associative_memory.AssociativeMemory,
    players: Sequence[entity_agent_with_logging.EntityAgentWithLogging],
    clock: game_clock.MultiIntervalClock,
    player_configs: Sequence[formative_memories.AgentConfig],
    scene_type_name: str,
    sampled_settings: Any,
    verbose: bool = False,
) -> tuple[scene_lib.SceneTypeSpec, SchellingPayoffs]:
  """Add a minigame scene spec.

  Args:
    model: the language model to use.
    game_master_memory: the game master memory to use.
    players: the players to use.
    clock: the clock to use.
    player_configs: the player configs to use.
    scene_type_name: the name of the scene type.
    sampled_settings: the environment configuration containing the time and
      place details.
    verbose: whether to print verbose output or not.

  Returns:
    minigame_scene_type: the minigame scene type.
  """
  selected_minigame = sampled_settings.minigame
  cooperation_option = (
      selected_minigame.map_external_actions_to_schelling_diagram['cooperation']
  )
  contestant_names = [player_config.name for player_config in player_configs]
  schelling_payoffs = gm_components.schelling_diagram_payoffs.SchellingPayoffs(
      model=model,
      memory=game_master_memory,
      cooperative_option=cooperation_option,
      resolution_scene=DECISION_SCENE_TYPE,
      cooperator_reward_fn=selected_minigame.schelling_diagram.cooperation,
      defector_reward_fn=selected_minigame.schelling_diagram.defection,
      players=players,
      acting_player_names=[cfg.name for cfg in player_configs],
      outcome_summarization_fn=outcome_summary_fn,
      clock_now=clock.now,
      active_players_observe_joint_action_and_outcome=True,
      name='scoring function',
      verbose=verbose,
  )
  decision_env = game_master.GameMaster(
      model=model,
      memory=game_master_memory,
      clock=clock,
      name=f'{scene_type_name} decision environment',
      players=players,
      components=[schelling_payoffs],
      action_spec=selected_minigame.action_spec,
      update_thought_chain=[thought_chains_lib.identity],
      randomise_initiative=True,
      player_observes_event=False,
      concurrent_externalities=False,
      verbose=verbose,
  )
  public_conclusion = 'Everyone returned to the break room after the game.'
  minigame_scene_type = scene_lib.SceneTypeSpec(
      name=scene_type_name,
      premise={
          name: [selected_minigame.public_premise] for name in contestant_names
      },
      conclusion={name: [public_conclusion] for name in contestant_names},
      action_spec=selected_minigame.action_spec,
      override_game_master=decision_env,
  )
  return minigame_scene_type, schelling_payoffs
Add a minigame scene spec.

  Args:
    model: the language model to use.
    game_master_memory: the game master memory to use.
    players: the players to use.
    clock: the clock to use.
    player_configs: the player configs to use.
    scene_type_name: the name of the scene type.
    sampled_settings: the environment configuration containing the time and
      place details.
    verbose: whether to print verbose output or not.

  Returns:
    minigame_scene_type: the minigame scene type.
  
examples/deprecated/modular/environment/reality_show.py