def __init__(
      self,
      model: language_model.LanguageModel,
      retry_on_exceptions: Collection[Type[Exception]] = (Exception,),
      retry_tries: int = 3,
      retry_delay: float = 2.,
      jitter: tuple[float, float] = (0.0, 1.0),
  ) -> None:
    """Wrap the underlying language model with retries on given exceptions.

    Args:
      model: A language model to wrap with retries.
      retry_on_exceptions: the exception exceptions to retry on.
      retry_tries: number of retries before failing.
      retry_delay: minimum delay between retries.
      jitter: tuple of minimum and maximum jitter to add to the retry.
    """
    self._model = model
    self._retry_on_exceptions = tuple(retry_on_exceptions)
    self._retry_tries = retry_tries
    self._retry_delay = retry_delay
    self._jitter = jitter
Wrap the underlying language model with retries on given exceptions.

    Args:
      model: A language model to wrap with retries.
      retry_on_exceptions: the exception exceptions to retry on.
      retry_tries: number of retries before failing.
      retry_delay: minimum delay between retries.
      jitter: tuple of minimum and maximum jitter to add to the retry.
    
concordia/language_model/retry_wrapper.py