Aller directement au contenu principal

openhands.llm.retry_mixin

RetryMixin Objects

class RetryMixin()

Mixin class for retry logic.

retry_decorator

def retry_decorator(**kwargs)

Create a LLM retry decorator with customizable parameters. This is used for 429 errors, and a few other exceptions in LLM classes.

Arguments:

  • **kwargs - Keyword arguments to override default retry behavior.
  • Keys - num_retries, retry_exceptions, retry_min_wait, retry_max_wait, retry_multiplier

Returns:

A retry decorator with the parameters customizable in configuration.

log_retry_attempt

def log_retry_attempt(retry_state)

Log retry attempts.