From 7a98953fae672142ef3e55ab1329436d860989b9 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Wed, 8 May 2024 14:13:50 -0700 Subject: [PATCH] split repo map and added files into 2 user messages --- aider/coders/base_coder.py | 15 +++++++-------- aider/coders/base_prompts.py | 3 ++- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/aider/coders/base_coder.py b/aider/coders/base_coder.py index 59416fa29..1a49d61c0 100755 --- a/aider/coders/base_coder.py +++ b/aider/coders/base_coder.py @@ -417,13 +417,14 @@ class Coder: return repo_content def get_files_messages(self): - all_content = "" + files_messages = [] repo_content = self.get_repo_map() if repo_content: - if all_content: - all_content += "\n" - all_content += repo_content + "\n" + files_messages += [ + dict(role="user", content=repo_content), + dict(role="assistant", content="Ok."), + ] if self.abs_fnames: files_content = self.gpt_prompts.files_content_prefix @@ -431,10 +432,8 @@ class Coder: else: files_content = self.gpt_prompts.files_no_full_files - all_content += files_content - - files_messages = [ - dict(role="user", content=all_content), + files_messages += [ + dict(role="user", content=files_content), dict(role="assistant", content="Ok."), ] diff --git a/aider/coders/base_prompts.py b/aider/coders/base_prompts.py index 6637b752d..ee0136822 100644 --- a/aider/coders/base_prompts.py +++ b/aider/coders/base_prompts.py @@ -23,5 +23,6 @@ You always COMPLETELY IMPLEMENT the needed code! repo_content_prefix = """I'm discussing files that are part of a git repository. Here are summaries of some files present in my git repo. Do not propose changes to these files, treat them as *read-only*. -If you need to edit one of them, ask me to *add it to the chat* first. +If you need to edit any of these files, ask me to *add them to the chat* first, +so I can show you their full content. """