langgoap.ActionQos#
- class ActionQos(max_attempts=1, backoff_initial_ms=250.0, backoff_multiplier=2.0, backoff_max_ms=30000.0, jitter=0.1, idempotent=False, retryable_exceptions=(<class 'TimeoutError'>, ))[source]#
Quality-of-service / retry policy for a single action.
- Parameters:
max_attempts (int)
backoff_initial_ms (float)
backoff_multiplier (float)
backoff_max_ms (float)
jitter (float)
idempotent (bool)
retryable_exceptions (tuple[type[BaseException], ...])
- max_attempts#
Total attempts allowed (1 = no retry).
- Type:
int
- backoff_initial_ms#
Wait between attempt 1 and 2.
- Type:
float
- backoff_multiplier#
Factor applied each subsequent retry.
- Type:
float
- backoff_max_ms#
Hard cap on a single backoff interval.
- Type:
float
- jitter#
Multiplicative noise applied to each backoff in
[1 - jitter, 1 + jitter].0.0disables jitter.- Type:
float
- idempotent#
When
True, retry on any exception. WhenFalse, retry only on exceptions inretryable_exceptions.- Type:
bool
- retryable_exceptions#
Tuple of exception types that are safe to retry even for non-idempotent actions (network hiccups, timeouts). Default:
(TimeoutError,).- Type:
tuple[type[BaseException], …]
- __init__(max_attempts=1, backoff_initial_ms=250.0, backoff_multiplier=2.0, backoff_max_ms=30000.0, jitter=0.1, idempotent=False, retryable_exceptions=(<class 'TimeoutError'>, ))#
- Parameters:
max_attempts (int)
backoff_initial_ms (float)
backoff_multiplier (float)
backoff_max_ms (float)
jitter (float)
idempotent (bool)
retryable_exceptions (tuple[type[BaseException], ...])
- Return type:
None
Methods
__init__([max_attempts, backoff_initial_ms, ...])compute_backoff_ms(attempt, *[, rng])Backoff in milliseconds before retrying after
attempt.from_dict(data)Reconstruct from
to_dict()output (exceptions reset to default).should_retry(exception, attempt)Decide whether to retry after
exceptiononattempt.to_dict()Serialise to a JSON-native dict.
Attributes