def __init__(
      self,
      model: language_model.LanguageModel,
      contents: Iterable[document.Content] = (),
      rng: np.random.Generator | None = None,
  ) -> None:
    """Initializes the instance.

    Args:
      model: language model to interact with.
      contents: initial contents of the document.
      rng: randomization source.
    """
    super().__init__(contents)
    if rng:
      self._rng = rng
    else:
      self._rng = np.random.default_rng()
    self._model = model
    self._model_view = self.view()
    # TODO: b/311191701 - debug log some useful stuff?
Initializes the instance.

    Args:
      model: language model to interact with.
      contents: initial contents of the document.
      rng: randomization source.
    
concordia/document/interactive_document.py