Skip to content

Commit

Permalink
feat: for the first reflection use the (quicker) editor model
Browse files Browse the repository at this point in the history
  • Loading branch information
jbellis committed Jan 23, 2025
1 parent 05a77c7 commit 83a273e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions aider/coders/base_coder.py
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,10 @@ def run_one(self, user_message, preproc):

while message:
self.reflected_message = None
list(self.send_message(message))
# for the first reflection use the (quicker) editor model; if it takes more than 1 retry though
# use the (potentially slower) main model
send_model = self.main_model.editor_model if self.num_reflections == 1 else self.main_model
list(self.send_message(message, model=send_model))

if not self.reflected_message:
break
Expand Down Expand Up @@ -1230,7 +1233,7 @@ def warm_cache_worker():

return chunks

def send_message(self, inp):
def send_message(self, inp, model=None):
self.event("message_send_starting")

self.cur_messages += [
Expand Down Expand Up @@ -1260,7 +1263,7 @@ def send_message(self, inp):
try:
while True:
try:
yield from self.send(messages, functions=self.functions)
yield from self.send(messages, model=model, functions=self.functions)
break
except litellm_ex.exceptions_tuple() as err:
ex_info = litellm_ex.get_ex_info(err)
Expand Down

0 comments on commit 83a273e

Please sign in to comment.