def retry_request(
    request_func: Callable[..., Any], max_retries: int = 10, *args: Any, **kwargs: Any
) -> Any:
    """
    Retry a request function.

    Args:
        request_func (Callable[..., Any]): The request function.
        max_retries (int): The maximum number of retries.
        *args (Any): The positional arguments.
        **kwargs (Any): The keyword arguments.

    Returns:
        Any: The response.

    """
    retry_func = create_retry_decorator(max_retries)

    @retry_func
    def retry_func(request_func: Callable[..., Any], *args: Any, **kwargs: Any) -> Any:
        return request_func(*args, **kwargs)

    return retry_func(request_func, *args, **kwargs)

    Retry a request function.

    Args:
        request_func (Callable[..., Any]): The request function.
        max_retries (int): The maximum number of retries.
        *args (Any): The positional arguments.
        **kwargs (Any): The keyword arguments.

    Returns:
        Any: The response.

    
llama-index-integrations/llms/llama-index-llms-deepinfra/llama_index/llms/deepinfra/utils.py