mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 22:34:59 +00:00
implemented accepts_multi_system_msgs
This commit is contained in:
parent
2d16ee16ac
commit
d38a38f0dd
2 changed files with 16 additions and 3 deletions
|
@ -547,11 +547,21 @@ class Coder:
|
|||
total_tokens = 0
|
||||
|
||||
messages += self.cur_messages
|
||||
messages[-1]["content"] += "\n\n" + self.fmt_system_prompt(self.gpt_prompts.system_reminder)
|
||||
|
||||
final = messages[-1]
|
||||
|
||||
# Add the reminder prompt if we still have room to include it.
|
||||
# if total_tokens < self.main_model.info.get("max_input_tokens", 0):
|
||||
# messages += reminder_message
|
||||
if total_tokens < self.main_model.info.get("max_input_tokens", 0):
|
||||
if self.main_model.accepts_multi_system_msgs:
|
||||
messages += reminder_message
|
||||
elif final["role"] == "user":
|
||||
# stuff it into the user message
|
||||
new_content = (
|
||||
final["content"]
|
||||
+ "\n\n"
|
||||
+ self.fmt_system_prompt(self.gpt_prompts.system_reminder)
|
||||
)
|
||||
messages[-1] = dict(role=final["role"], content=new_content)
|
||||
|
||||
return messages
|
||||
|
||||
|
|
|
@ -235,6 +235,9 @@ class Model:
|
|||
self.send_undo_reply = True
|
||||
return # <--
|
||||
|
||||
if "gpt-3.5" in model or "gpt-4" in model:
|
||||
self.accepts_multi_system_msgs = True
|
||||
|
||||
# use the defaults
|
||||
if self.edit_format == "diff":
|
||||
self.use_repo_map = True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue