mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-28 16:25:00 +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
|
||||
interrupted = False
|
||||
try:
|
||||
# ai: replicate this try/except retry loop...
|
||||
while True:
|
||||
try:
|
||||
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...")
|
||||
time.sleep(retry_delay)
|
||||
continue
|
||||
# ai: ... down to here
|
||||
except KeyboardInterrupt:
|
||||
interrupted = True
|
||||
break
|
||||
|
|
|
@ -102,7 +102,7 @@ def send_completion(
|
|||
return hash_object, res
|
||||
|
||||
|
||||
@lazy_litellm_retry_decorator
|
||||
# ai: in this function!
|
||||
def simple_send_with_retries(model_name, messages, extra_params=None):
|
||||
try:
|
||||
kwargs = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue