mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 02:05:00 +00:00
ModelSettings.reminder_as_sys_msg:true/false -> reminder:sys/user/None
This commit is contained in:
parent
455487e5a9
commit
c13b277070
3 changed files with 34 additions and 29 deletions
|
@ -1015,9 +1015,9 @@ class Coder:
|
||||||
or total_tokens < max_input_tokens
|
or total_tokens < max_input_tokens
|
||||||
and self.gpt_prompts.system_reminder
|
and self.gpt_prompts.system_reminder
|
||||||
):
|
):
|
||||||
if self.main_model.reminder_as_sys_msg:
|
if self.main_model.reminder == "sys":
|
||||||
chunks.reminder = reminder_message
|
chunks.reminder = reminder_message
|
||||||
elif final["role"] == "user":
|
elif self.main_model.reminder == "user" and final["role"] == "user":
|
||||||
# stuff it into the user message
|
# stuff it into the user message
|
||||||
new_content = (
|
new_content = (
|
||||||
final["content"]
|
final["content"]
|
||||||
|
|
|
@ -70,7 +70,7 @@ class ModelSettings:
|
||||||
send_undo_reply: bool = False
|
send_undo_reply: bool = False
|
||||||
accepts_images: bool = False
|
accepts_images: bool = False
|
||||||
lazy: bool = False
|
lazy: bool = False
|
||||||
reminder_as_sys_msg: bool = False
|
reminder: str = "user"
|
||||||
examples_as_sys_msg: bool = False
|
examples_as_sys_msg: bool = False
|
||||||
extra_headers: Optional[dict] = None
|
extra_headers: Optional[dict] = None
|
||||||
max_tokens: Optional[int] = None
|
max_tokens: Optional[int] = None
|
||||||
|
@ -87,31 +87,31 @@ MODEL_SETTINGS = [
|
||||||
"gpt-3.5-turbo",
|
"gpt-3.5-turbo",
|
||||||
"whole",
|
"whole",
|
||||||
weak_model_name="gpt-4o-mini",
|
weak_model_name="gpt-4o-mini",
|
||||||
reminder_as_sys_msg=True,
|
reminder="sys",
|
||||||
),
|
),
|
||||||
ModelSettings(
|
ModelSettings(
|
||||||
"gpt-3.5-turbo-0125",
|
"gpt-3.5-turbo-0125",
|
||||||
"whole",
|
"whole",
|
||||||
weak_model_name="gpt-4o-mini",
|
weak_model_name="gpt-4o-mini",
|
||||||
reminder_as_sys_msg=True,
|
reminder="sys",
|
||||||
),
|
),
|
||||||
ModelSettings(
|
ModelSettings(
|
||||||
"gpt-3.5-turbo-1106",
|
"gpt-3.5-turbo-1106",
|
||||||
"whole",
|
"whole",
|
||||||
weak_model_name="gpt-4o-mini",
|
weak_model_name="gpt-4o-mini",
|
||||||
reminder_as_sys_msg=True,
|
reminder="sys",
|
||||||
),
|
),
|
||||||
ModelSettings(
|
ModelSettings(
|
||||||
"gpt-3.5-turbo-0613",
|
"gpt-3.5-turbo-0613",
|
||||||
"whole",
|
"whole",
|
||||||
weak_model_name="gpt-4o-mini",
|
weak_model_name="gpt-4o-mini",
|
||||||
reminder_as_sys_msg=True,
|
reminder="sys",
|
||||||
),
|
),
|
||||||
ModelSettings(
|
ModelSettings(
|
||||||
"gpt-3.5-turbo-16k-0613",
|
"gpt-3.5-turbo-16k-0613",
|
||||||
"whole",
|
"whole",
|
||||||
weak_model_name="gpt-4o-mini",
|
weak_model_name="gpt-4o-mini",
|
||||||
reminder_as_sys_msg=True,
|
reminder="sys",
|
||||||
),
|
),
|
||||||
# gpt-4
|
# gpt-4
|
||||||
ModelSettings(
|
ModelSettings(
|
||||||
|
@ -122,7 +122,7 @@ MODEL_SETTINGS = [
|
||||||
send_undo_reply=True,
|
send_undo_reply=True,
|
||||||
accepts_images=True,
|
accepts_images=True,
|
||||||
lazy=True,
|
lazy=True,
|
||||||
reminder_as_sys_msg=True,
|
reminder="sys",
|
||||||
),
|
),
|
||||||
ModelSettings(
|
ModelSettings(
|
||||||
"gpt-4-turbo",
|
"gpt-4-turbo",
|
||||||
|
@ -132,7 +132,7 @@ MODEL_SETTINGS = [
|
||||||
send_undo_reply=True,
|
send_undo_reply=True,
|
||||||
accepts_images=True,
|
accepts_images=True,
|
||||||
lazy=True,
|
lazy=True,
|
||||||
reminder_as_sys_msg=True,
|
reminder="sys",
|
||||||
),
|
),
|
||||||
ModelSettings(
|
ModelSettings(
|
||||||
"openai/gpt-4o",
|
"openai/gpt-4o",
|
||||||
|
@ -142,7 +142,7 @@ MODEL_SETTINGS = [
|
||||||
send_undo_reply=True,
|
send_undo_reply=True,
|
||||||
accepts_images=True,
|
accepts_images=True,
|
||||||
lazy=True,
|
lazy=True,
|
||||||
reminder_as_sys_msg=True,
|
reminder="sys",
|
||||||
),
|
),
|
||||||
ModelSettings(
|
ModelSettings(
|
||||||
"openai/gpt-4o-2024-08-06",
|
"openai/gpt-4o-2024-08-06",
|
||||||
|
@ -152,7 +152,7 @@ MODEL_SETTINGS = [
|
||||||
send_undo_reply=True,
|
send_undo_reply=True,
|
||||||
accepts_images=True,
|
accepts_images=True,
|
||||||
lazy=True,
|
lazy=True,
|
||||||
reminder_as_sys_msg=True,
|
reminder="sys",
|
||||||
),
|
),
|
||||||
ModelSettings(
|
ModelSettings(
|
||||||
"gpt-4o-2024-08-06",
|
"gpt-4o-2024-08-06",
|
||||||
|
@ -162,7 +162,7 @@ MODEL_SETTINGS = [
|
||||||
send_undo_reply=True,
|
send_undo_reply=True,
|
||||||
accepts_images=True,
|
accepts_images=True,
|
||||||
lazy=True,
|
lazy=True,
|
||||||
reminder_as_sys_msg=True,
|
reminder="sys",
|
||||||
),
|
),
|
||||||
ModelSettings(
|
ModelSettings(
|
||||||
"gpt-4o",
|
"gpt-4o",
|
||||||
|
@ -172,7 +172,7 @@ MODEL_SETTINGS = [
|
||||||
send_undo_reply=True,
|
send_undo_reply=True,
|
||||||
accepts_images=True,
|
accepts_images=True,
|
||||||
lazy=True,
|
lazy=True,
|
||||||
reminder_as_sys_msg=True,
|
reminder="sys",
|
||||||
),
|
),
|
||||||
ModelSettings(
|
ModelSettings(
|
||||||
"gpt-4o-mini",
|
"gpt-4o-mini",
|
||||||
|
@ -180,7 +180,7 @@ MODEL_SETTINGS = [
|
||||||
weak_model_name="gpt-4o-mini",
|
weak_model_name="gpt-4o-mini",
|
||||||
accepts_images=True,
|
accepts_images=True,
|
||||||
lazy=True,
|
lazy=True,
|
||||||
reminder_as_sys_msg=True,
|
reminder="sys",
|
||||||
),
|
),
|
||||||
ModelSettings(
|
ModelSettings(
|
||||||
"openai/gpt-4o-mini",
|
"openai/gpt-4o-mini",
|
||||||
|
@ -188,7 +188,7 @@ MODEL_SETTINGS = [
|
||||||
weak_model_name="openai/gpt-4o-mini",
|
weak_model_name="openai/gpt-4o-mini",
|
||||||
accepts_images=True,
|
accepts_images=True,
|
||||||
lazy=True,
|
lazy=True,
|
||||||
reminder_as_sys_msg=True,
|
reminder="sys",
|
||||||
),
|
),
|
||||||
ModelSettings(
|
ModelSettings(
|
||||||
"gpt-4-0125-preview",
|
"gpt-4-0125-preview",
|
||||||
|
@ -197,7 +197,7 @@ MODEL_SETTINGS = [
|
||||||
use_repo_map=True,
|
use_repo_map=True,
|
||||||
send_undo_reply=True,
|
send_undo_reply=True,
|
||||||
lazy=True,
|
lazy=True,
|
||||||
reminder_as_sys_msg=True,
|
reminder="sys",
|
||||||
examples_as_sys_msg=True,
|
examples_as_sys_msg=True,
|
||||||
),
|
),
|
||||||
ModelSettings(
|
ModelSettings(
|
||||||
|
@ -207,7 +207,7 @@ MODEL_SETTINGS = [
|
||||||
use_repo_map=True,
|
use_repo_map=True,
|
||||||
send_undo_reply=True,
|
send_undo_reply=True,
|
||||||
lazy=True,
|
lazy=True,
|
||||||
reminder_as_sys_msg=True,
|
reminder="sys",
|
||||||
),
|
),
|
||||||
ModelSettings(
|
ModelSettings(
|
||||||
"gpt-4-vision-preview",
|
"gpt-4-vision-preview",
|
||||||
|
@ -216,7 +216,7 @@ MODEL_SETTINGS = [
|
||||||
use_repo_map=True,
|
use_repo_map=True,
|
||||||
send_undo_reply=True,
|
send_undo_reply=True,
|
||||||
accepts_images=True,
|
accepts_images=True,
|
||||||
reminder_as_sys_msg=True,
|
reminder="sys",
|
||||||
),
|
),
|
||||||
ModelSettings(
|
ModelSettings(
|
||||||
"gpt-4-0314",
|
"gpt-4-0314",
|
||||||
|
@ -224,7 +224,7 @@ MODEL_SETTINGS = [
|
||||||
weak_model_name="gpt-4o-mini",
|
weak_model_name="gpt-4o-mini",
|
||||||
use_repo_map=True,
|
use_repo_map=True,
|
||||||
send_undo_reply=True,
|
send_undo_reply=True,
|
||||||
reminder_as_sys_msg=True,
|
reminder="sys",
|
||||||
examples_as_sys_msg=True,
|
examples_as_sys_msg=True,
|
||||||
),
|
),
|
||||||
ModelSettings(
|
ModelSettings(
|
||||||
|
@ -233,7 +233,7 @@ MODEL_SETTINGS = [
|
||||||
weak_model_name="gpt-4o-mini",
|
weak_model_name="gpt-4o-mini",
|
||||||
use_repo_map=True,
|
use_repo_map=True,
|
||||||
send_undo_reply=True,
|
send_undo_reply=True,
|
||||||
reminder_as_sys_msg=True,
|
reminder="sys",
|
||||||
),
|
),
|
||||||
ModelSettings(
|
ModelSettings(
|
||||||
"gpt-4-32k-0613",
|
"gpt-4-32k-0613",
|
||||||
|
@ -241,7 +241,7 @@ MODEL_SETTINGS = [
|
||||||
weak_model_name="gpt-4o-mini",
|
weak_model_name="gpt-4o-mini",
|
||||||
use_repo_map=True,
|
use_repo_map=True,
|
||||||
send_undo_reply=True,
|
send_undo_reply=True,
|
||||||
reminder_as_sys_msg=True,
|
reminder="sys",
|
||||||
),
|
),
|
||||||
# Claude
|
# Claude
|
||||||
ModelSettings(
|
ModelSettings(
|
||||||
|
@ -275,6 +275,7 @@ MODEL_SETTINGS = [
|
||||||
"anthropic-beta": ANTHROPIC_BETA_HEADER,
|
"anthropic-beta": ANTHROPIC_BETA_HEADER,
|
||||||
},
|
},
|
||||||
cache_control=True,
|
cache_control=True,
|
||||||
|
reminder=None,
|
||||||
),
|
),
|
||||||
ModelSettings(
|
ModelSettings(
|
||||||
"anthropic/claude-3-5-sonnet-20240620",
|
"anthropic/claude-3-5-sonnet-20240620",
|
||||||
|
@ -287,6 +288,7 @@ MODEL_SETTINGS = [
|
||||||
"anthropic-beta": ANTHROPIC_BETA_HEADER,
|
"anthropic-beta": ANTHROPIC_BETA_HEADER,
|
||||||
},
|
},
|
||||||
cache_control=True,
|
cache_control=True,
|
||||||
|
reminder=None,
|
||||||
),
|
),
|
||||||
ModelSettings(
|
ModelSettings(
|
||||||
"anthropic/claude-3-haiku-20240307",
|
"anthropic/claude-3-haiku-20240307",
|
||||||
|
@ -321,6 +323,7 @@ MODEL_SETTINGS = [
|
||||||
"HTTP-Referer": AIDER_SITE_URL,
|
"HTTP-Referer": AIDER_SITE_URL,
|
||||||
"X-Title": AIDER_APP_NAME,
|
"X-Title": AIDER_APP_NAME,
|
||||||
},
|
},
|
||||||
|
reminder=None,
|
||||||
),
|
),
|
||||||
# Vertex AI Claude models
|
# Vertex AI Claude models
|
||||||
# Does not yet support 8k token
|
# Does not yet support 8k token
|
||||||
|
@ -331,6 +334,7 @@ MODEL_SETTINGS = [
|
||||||
use_repo_map=True,
|
use_repo_map=True,
|
||||||
examples_as_sys_msg=True,
|
examples_as_sys_msg=True,
|
||||||
accepts_images=True,
|
accepts_images=True,
|
||||||
|
reminder=None,
|
||||||
),
|
),
|
||||||
ModelSettings(
|
ModelSettings(
|
||||||
"vertex_ai/claude-3-opus@20240229",
|
"vertex_ai/claude-3-opus@20240229",
|
||||||
|
@ -389,7 +393,7 @@ MODEL_SETTINGS = [
|
||||||
use_repo_map=True,
|
use_repo_map=True,
|
||||||
send_undo_reply=True,
|
send_undo_reply=True,
|
||||||
examples_as_sys_msg=True,
|
examples_as_sys_msg=True,
|
||||||
reminder_as_sys_msg=True,
|
reminder="sys",
|
||||||
),
|
),
|
||||||
ModelSettings(
|
ModelSettings(
|
||||||
"deepseek/deepseek-coder",
|
"deepseek/deepseek-coder",
|
||||||
|
@ -397,7 +401,7 @@ MODEL_SETTINGS = [
|
||||||
use_repo_map=True,
|
use_repo_map=True,
|
||||||
send_undo_reply=True,
|
send_undo_reply=True,
|
||||||
examples_as_sys_msg=True,
|
examples_as_sys_msg=True,
|
||||||
reminder_as_sys_msg=True,
|
reminder="sys",
|
||||||
),
|
),
|
||||||
ModelSettings(
|
ModelSettings(
|
||||||
"openrouter/deepseek/deepseek-coder",
|
"openrouter/deepseek/deepseek-coder",
|
||||||
|
@ -405,7 +409,7 @@ MODEL_SETTINGS = [
|
||||||
use_repo_map=True,
|
use_repo_map=True,
|
||||||
send_undo_reply=True,
|
send_undo_reply=True,
|
||||||
examples_as_sys_msg=True,
|
examples_as_sys_msg=True,
|
||||||
reminder_as_sys_msg=True,
|
reminder="sys",
|
||||||
),
|
),
|
||||||
ModelSettings(
|
ModelSettings(
|
||||||
"openrouter/openai/gpt-4o",
|
"openrouter/openai/gpt-4o",
|
||||||
|
@ -415,7 +419,7 @@ MODEL_SETTINGS = [
|
||||||
send_undo_reply=True,
|
send_undo_reply=True,
|
||||||
accepts_images=True,
|
accepts_images=True,
|
||||||
lazy=True,
|
lazy=True,
|
||||||
reminder_as_sys_msg=True,
|
reminder="sys",
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -500,12 +504,13 @@ class Model:
|
||||||
return # <--
|
return # <--
|
||||||
|
|
||||||
if "gpt-3.5" in model or "gpt-4" in model:
|
if "gpt-3.5" in model or "gpt-4" in model:
|
||||||
self.reminder_as_sys_msg = True
|
self.reminder = "sys"
|
||||||
|
|
||||||
if "3.5-sonnet" in model or "3-5-sonnet" in model:
|
if "3.5-sonnet" in model or "3-5-sonnet" in model:
|
||||||
self.edit_format = "diff"
|
self.edit_format = "diff"
|
||||||
self.use_repo_map = True
|
self.use_repo_map = True
|
||||||
self.examples_as_sys_msg = True
|
self.examples_as_sys_msg = True
|
||||||
|
self.reminder = None
|
||||||
|
|
||||||
# use the defaults
|
# use the defaults
|
||||||
if self.edit_format == "diff":
|
if self.edit_format == "diff":
|
||||||
|
|
|
@ -76,7 +76,7 @@ The yaml file should be a a list of dictionary objects for each model, as follow
|
||||||
send_undo_reply: false
|
send_undo_reply: false
|
||||||
accepts_images: false
|
accepts_images: false
|
||||||
lazy: false
|
lazy: false
|
||||||
reminder_as_sys_msg: true
|
reminder: sys
|
||||||
examples_as_sys_msg: false
|
examples_as_sys_msg: false
|
||||||
- name: "gpt-4-turbo-2024-04-09"
|
- name: "gpt-4-turbo-2024-04-09"
|
||||||
edit_format: "udiff"
|
edit_format: "udiff"
|
||||||
|
@ -85,7 +85,7 @@ The yaml file should be a a list of dictionary objects for each model, as follow
|
||||||
send_undo_reply: true
|
send_undo_reply: true
|
||||||
accepts_images: true
|
accepts_images: true
|
||||||
lazy: true
|
lazy: true
|
||||||
reminder_as_sys_msg: true
|
reminder: sys
|
||||||
examples_as_sys_msg: false
|
examples_as_sys_msg: false
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue