mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-30 17:24:59 +00:00
refactor: Move retry logic from base_coder to sendchat module
This commit is contained in:
parent
54d55c857b
commit
f9c45432e6
2 changed files with 3 additions and 1 deletions
|
@ -1124,6 +1124,7 @@ class Coder:
|
||||||
exhausted = False
|
exhausted = False
|
||||||
interrupted = False
|
interrupted = False
|
||||||
try:
|
try:
|
||||||
|
# ai: replicate this try/except retry loop...
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
yield from self.send(messages, functions=self.functions)
|
yield from self.send(messages, functions=self.functions)
|
||||||
|
@ -1136,6 +1137,7 @@ class Coder:
|
||||||
self.io.tool_output(f"Retrying in {retry_delay:.1f} seconds...")
|
self.io.tool_output(f"Retrying in {retry_delay:.1f} seconds...")
|
||||||
time.sleep(retry_delay)
|
time.sleep(retry_delay)
|
||||||
continue
|
continue
|
||||||
|
# ai: ... down to here
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
interrupted = True
|
interrupted = True
|
||||||
break
|
break
|
||||||
|
|
|
@ -102,7 +102,7 @@ def send_completion(
|
||||||
return hash_object, res
|
return hash_object, res
|
||||||
|
|
||||||
|
|
||||||
@lazy_litellm_retry_decorator
|
# ai: in this function!
|
||||||
def simple_send_with_retries(model_name, messages, extra_params=None):
|
def simple_send_with_retries(model_name, messages, extra_params=None):
|
||||||
try:
|
try:
|
||||||
kwargs = {
|
kwargs = {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue