mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-30 09:14:59 +00:00
retry on APIConnectionError
This commit is contained in:
parent
86309f336c
commit
3e4b4d1b0d
1 changed files with 8 additions and 1 deletions
|
@ -4,7 +4,13 @@ import json
|
||||||
import backoff
|
import backoff
|
||||||
import openai
|
import openai
|
||||||
import requests
|
import requests
|
||||||
from openai.error import APIError, RateLimitError, ServiceUnavailableError, Timeout
|
from openai.error import (
|
||||||
|
APIConnectionError,
|
||||||
|
APIError,
|
||||||
|
RateLimitError,
|
||||||
|
ServiceUnavailableError,
|
||||||
|
Timeout,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@backoff.on_exception(
|
@backoff.on_exception(
|
||||||
|
@ -14,6 +20,7 @@ from openai.error import APIError, RateLimitError, ServiceUnavailableError, Time
|
||||||
APIError,
|
APIError,
|
||||||
ServiceUnavailableError,
|
ServiceUnavailableError,
|
||||||
RateLimitError,
|
RateLimitError,
|
||||||
|
APIConnectionError,
|
||||||
requests.exceptions.ConnectionError,
|
requests.exceptions.ConnectionError,
|
||||||
),
|
),
|
||||||
max_tries=10,
|
max_tries=10,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue