pyrit.exceptions.pyrit_target_retry

pyrit.exceptions.pyrit_target_retry#

pyrit_target_retry(func: Callable) Callable[source]#

A decorator to apply retry logic with exponential backoff to a function.

Retries the function if it raises RateLimitError or EmptyResponseException, with a wait time between retries that follows an exponential backoff strategy. Logs retry attempts at the INFO level and stops after a maximum number of attempts.

Parameters:

func (Callable) – The function to be decorated.

Returns:

The decorated function with retry logic applied.

Return type:

Callable