Python Vision Agent
Retry
askui.retry.Retry
Abstract base class for implementing retry mechanisms.
This abstract class defines the interface for retry mechanisms. Concrete
implementations should define how the retry logic works by implementing
the abstract attempt
method.
Example:
attempt
Attempt to execute a function with retry logic.
Arguments:
func
- The function to execute with retry logic
Returns:
The result of the function execution
Raises:
Exception
- Any exception that occurs during execution after all retry attempts are exhausted
askui.retry.ConfigurableRetry
A configurable retry implementation with different strategies.
This class provides a flexible way to retry operations that may fail temporarily, supporting different retry strategies (Exponential, Fixed, Linear) and configurable parameters for delay and retry count.
Arguments:
on_exception_types
Tuple[Type[Exception]] - Tuple of exception types that should trigger a retrystrategy
Literal[“Exponential”, “Fixed”, “Linear”] - The retry strategy to use:"Exponential"
: Delay increases exponentially between retries"Fixed"
: Constant delay between retries"Linear"
: Delay increases linearly between retries
base_delay
int, optional - Base delay in milliseconds between retries.retry_count
int, optional - Maximum number of retry attempts.
Example: