split repo map and added files into 2 user messages

This commit is contained in:
Paul Gauthier 2024-05-08 14:13:50 -07:00
parent 6a01b66b2c
commit 7a98953fae
2 changed files with 9 additions and 9 deletions

View file

@ -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."),
]

View file

@ -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.
"""