def __init__(
      self,
      *,
      model: language_model.LanguageModel,
      player_name: str,
      player_names: Sequence[str],
      context_fn: Callable[[], str],
      clock: game_clock.GameClock,
      name: str = 'Opinion',
      scale: Sequence[str] = DEFAULT_SCALE,
      verbose: bool = False,
      measurements: measurements_lib.Measurements | None = None,
      channel: str = DEFAULT_CHANNEL_NAME,
      question: str = 'What is {opining_player}\'s opinion of {of_player}?',
  ):
    """Initializes the metric.

    Args:
      model: Language model to use for the question.
      player_name: The name of the player opining on others.
      player_names: List of player names, might include the opining player.
      context_fn: The function to get the context text for the question.
        (typically this is the player state). This function will be called on
        `update`.
      clock: Clock for logging.
      name: Name of the metric.
      scale: Scale of the metric, uses default if None.
      verbose: Whether to print logs during execution.
      measurements: The measurements object to publish data to.
      channel: Channel to use for logging the metric.
      question: The question to ask the player about opinions on other players.
        Must have two formatting fields: "{opining_player}" and "{of_player}".

    Raises:
      ValueError: If player_names or scale are empty.
    """
    self._model = model
    self._name = name
    self._clock = clock
    self._verbose = verbose
    self._player_name = player_name
    if player_names:
      self._player_names = list(player_names)
    else:
      raise ValueError('player_names must be specified.')
    self._context_fn = context_fn
    if scale:
      self._scale = list(scale)
    else:
      raise ValueError('scale must be specified.')
    self._measurements = measurements
    self._channel = channel
    # Get the channel so it is initialized. This is not strictly necessary, but
    # enables us to know which channels exist after initialization of agents and
    # GM.
    if self._measurements:
      self._measurements.get_channel(self._channel)
    self._question = question

    self._timestep = 0
Initializes the metric.

    Args:
      model: Language model to use for the question.
      player_name: The name of the player opining on others.
      player_names: List of player names, might include the opining player.
      context_fn: The function to get the context text for the question.
        (typically this is the player state). This function will be called on
        `update`.
      clock: Clock for logging.
      name: Name of the metric.
      scale: Scale of the metric, uses default if None.
      verbose: Whether to print logs during execution.
      measurements: The measurements object to publish data to.
      channel: Channel to use for logging the metric.
      question: The question to ask the player about opinions on other players.
        Must have two formatting fields: "{opining_player}" and "{of_player}".

    Raises:
      ValueError: If player_names or scale are empty.
    
concordia/deprecated/metrics/opinion_of_others.py