def _retry_decorator(f: Callable) -> Callable:
    """
    Decorator to apply retry logic to a function using tenacity.

    Args:
        f (Callable): The function to be decorated.

    Returns:
        Callable: The decorated function with retry logic applied.

    """

    @functools.wraps(f)
    def wrapper(self, *args: Any, **kwargs: Any):
        retries = getattr(self, "retries", DEFAULT_RETRIES)
        if retries <= 0:
            return f(self, *args, **kwargs)
        backoff_factor = getattr(self, "backoff_factor", DEFAULT_BACKOFF_FACTOR)
        retry_func = _create_retry_decorator(
            max_retries=retries,
            backoff_factor=backoff_factor,
            random_exponential=False,
            stop_after_delay_seconds=getattr(self, "timeout", TIMEOUT),
            min_seconds=0,
            max_seconds=60,
        )

        return retry_func(f)(self, *args, **kwargs)

    return wrapper

    Decorator to apply retry logic to a function using tenacity.

    Args:
        f (Callable): The function to be decorated.

    Returns:
        Callable: The decorated function with retry logic applied.

    
llama-index-integrations/llms/llama-index-llms-oci-data-science/llama_index/llms/oci_data_science/client.py