RetryOptions#
Implement the model contract and normalize usage and stream output. See the guide.
- class zett_agent.model.RetryOptions(base_delay=0.25, max_delay=8.0, max_retries=3)[源代码]#
Model-owned exponential backoff, without jitter.
Wait base_delay seconds before the first retry, then double the delay until max_delay. max_retries counts additional attempts, not the initial request; zero disables retries. No sleep occurs after the final failure.
示例
Usage:
RetryOptions(base_delay=1.0, max_delay=5.0, max_retries=4) # At most five requests, separated by 1, 2, 4, and 5 seconds.
- 参数:
base_delay (float)
max_delay (float)
max_retries (int)
- base_delay: float#
Initial retry delay in seconds; zero allows immediate retries.
- max_delay: float#
Hard upper bound in seconds, including the first retry delay.
- max_retries: int#
Maximum additional requests after transient failures.