def _create_retry_decorator(
    max_retries: int,
    backoff_factor: float,
    random_exponential: bool = False,
    stop_after_delay_seconds: Optional[float] = None,
    min_seconds: float = 0,
    max_seconds: float = 60,
) -> Callable[[Any], Any]:
    """
    Create a tenacity retry decorator with the specified configuration.

    Args:
        max_retries (int): The maximum number of retry attempts.
        backoff_factor (float): The backoff factor for calculating retry delays.
        random_exponential (bool): Whether to use random exponential backoff.
        stop_after_delay_seconds (Optional[float]): Maximum total time to retry.
        min_seconds (float): Minimum wait time between retries.
        max_seconds (float): Maximum wait time between retries.

    Returns:
        Callable[[Any], Any]: A tenacity retry decorator configured with the specified strategy.

    """
    wait_strategy = (
        wait_random_exponential(min=min_seconds, max=max_seconds)
        if random_exponential
        else wait_exponential(
            multiplier=backoff_factor, min=min_seconds, max=max_seconds
        )
    )

    stop_strategy = stop_after_attempt(max_retries)
    if stop_after_delay_seconds is not None:
        stop_strategy = stop_strategy | stop_after_delay(stop_after_delay_seconds)

    retry_strategy = retry_if_exception(_should_retry_exception)
    return retry(
        wait=wait_strategy,
        stop=stop_strategy,
        retry=retry_strategy,
        reraise=True,
        before_sleep=before_sleep_log(logger, logging.WARNING),
    )

    Create a tenacity retry decorator with the specified configuration.

    Args:
        max_retries (int): The maximum number of retry attempts.
        backoff_factor (float): The backoff factor for calculating retry delays.
        random_exponential (bool): Whether to use random exponential backoff.
        stop_after_delay_seconds (Optional[float]): Maximum total time to retry.
        min_seconds (float): Minimum wait time between retries.
        max_seconds (float): Maximum wait time between retries.

    Returns:
        Callable[[Any], Any]: A tenacity retry decorator configured with the specified strategy.

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