diff --git a/aider/coders/base_coder.py b/aider/coders/base_coder.py index f0d7ab66f..15ca87a63 100755 --- a/aider/coders/base_coder.py +++ b/aider/coders/base_coder.py @@ -17,10 +17,10 @@ from rich.markdown import Markdown from aider import models, prompts, utils from aider.commands import Commands +from aider.history import ChatSummary from aider.repo import GitRepo from aider.repomap import RepoMap from aider.sendchat import send_with_retries -from aider.history import ChatSummary from ..dump import dump # noqa: F401 @@ -200,7 +200,7 @@ class Coder: if self.repo: self.repo.add_new_files(fnames) - self.summarizer = ChatSummary() + self.summarizer = ChatSummary(self.main_model.name) # validate the functions jsonschema if self.functions: diff --git a/aider/history.py b/aider/history.py index 6c164a076..e2441680f 100644 --- a/aider/history.py +++ b/aider/history.py @@ -15,6 +15,7 @@ class ChatSummary: def summarize(self, messages): num = len(messages) + dump(num) if num < 2: return messages @@ -66,6 +67,8 @@ class ChatSummary: ] summary = simple_send_with_retries(model=models.GPT35.name, messages=messages) + summary = prompts.summary_prefix + summary + dump(summary) return [dict(role="user", content=summary)] diff --git a/aider/prompts.py b/aider/prompts.py index fd1a56d59..79915d519 100644 --- a/aider/prompts.py +++ b/aider/prompts.py @@ -40,3 +40,5 @@ Write *as* the user. The user should refer to the assistant as *you*. Start the summary with "I asked you...". """ + +summary_prefix = "I spoke to you previously about a number of things.\n"