def __init__(
      self,
      model_name: str,
      *,
      api_key: str | None = None,
      measurements: measurements_lib.Measurements | None = None,
      channel: str = language_model.DEFAULT_STATS_CHANNEL,
  ):
    """Initializes the instance.

    Args:
      model_name: The language model to use. For more details, see
        https://api.together.xyz/models.
      api_key: The API key to use when accessing the Together AI API. If None,
        will use the TOGETHER_AI_API_KEY environment variable.
      measurements: The measurements object to log usage statistics to.
      channel: The channel to write the statistics to.
    """
    if api_key is None:
      api_key = os.environ['TOGETHER_AI_API_KEY']
    self._api_key = api_key
    self._model_name = model_name
    self._measurements = measurements
    self._channel = channel
    self._client = together.Together(api_key=self._api_key)
Initializes the instance.

    Args:
      model_name: The language model to use. For more details, see
        https://api.together.xyz/models.
      api_key: The API key to use when accessing the Together AI API. If None,
        will use the TOGETHER_AI_API_KEY environment variable.
      measurements: The measurements object to log usage statistics to.
      channel: The channel to write the statistics to.
    
concordia/language_model/together_ai.py