utils
langroid/language_models/utils.py
retry_with_exponential_backoff(func, initial_delay=1, exponential_base=1.3, jitter=True, max_retries=5, errors=(requests.exceptions.RequestException, openai.APITimeoutError, openai.RateLimitError, openai.AuthenticationError, openai.APIError, aiohttp.ServerTimeoutError, asyncio.TimeoutError))
¶
Retry a function with exponential backoff.
Source code in langroid/language_models/utils.py
async_retry_with_exponential_backoff(func, initial_delay=1, exponential_base=1.3, jitter=True, max_retries=5, errors=(openai.APITimeoutError, openai.RateLimitError, openai.AuthenticationError, openai.APIError, aiohttp.ServerTimeoutError, asyncio.TimeoutError))
¶
Retry a function with exponential backoff.