async def get_retryable_async_function(
    func: Callable[..., Awaitable[R]],
    max_retries: int = 3,
    min_seconds: float = 1,
    max_seconds: float = 10,
    exponential_base: float = 2,
) -> R:
    """
    Wraps an async function with tenacity retry logic based on configurable parameters.

    Args:
        func: The async function to wrap with retry logic
        max_retries: Maximum number of retry attempts
        min_seconds: Minimum wait time between retries
        max_seconds: Maximum wait time between retries
        exponential_base: Base for exponential backoff calculation

    Returns:
        The result of the async function after applying retry logic

    """
    retry_config = AsyncRetrying(
        reraise=True,
        stop=stop_after_attempt(max_retries),
        wait=wait_exponential(
            multiplier=min_seconds, max=max_seconds, exp_base=exponential_base
        ),
        retry=retry_if_exception(is_retryable_error),
    )

    async for attempt in retry_config:
        with attempt:
            return await func()

    raise Exception("Failed to get retryable async function")

    Wraps an async function with tenacity retry logic based on configurable parameters.

    Args:
        func: The async function to wrap with retry logic
        max_retries: Maximum number of retry attempts
        min_seconds: Minimum wait time between retries
        max_seconds: Maximum wait time between retries
        exponential_base: Base for exponential backoff calculation

    Returns:
        The result of the async function after applying retry logic

    
llama-index-integrations/embeddings/llama-index-embeddings-google-genai/llama_index/embeddings/google_genai/base.py