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 return repo_content
def get_files_messages(self): def get_files_messages(self):
all_content = "" files_messages = []
repo_content = self.get_repo_map() repo_content = self.get_repo_map()
if repo_content: if repo_content:
if all_content: files_messages += [
all_content += "\n" dict(role="user", content=repo_content),
all_content += repo_content + "\n" dict(role="assistant", content="Ok."),
]
if self.abs_fnames: if self.abs_fnames:
files_content = self.gpt_prompts.files_content_prefix files_content = self.gpt_prompts.files_content_prefix
@ -431,10 +432,8 @@ class Coder:
else: else:
files_content = self.gpt_prompts.files_no_full_files files_content = self.gpt_prompts.files_no_full_files
all_content += files_content files_messages += [
dict(role="user", content=files_content),
files_messages = [
dict(role="user", content=all_content),
dict(role="assistant", content="Ok."), 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. 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. Here are summaries of some files present in my git repo.
Do not propose changes to these files, treat them as *read-only*. 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.
""" """