This commit is contained in:
Paul Gauthier 2024-08-09 16:45:47 -03:00
parent 247b258c19
commit 2edace4e5f
2 changed files with 8 additions and 4 deletions

View file

@ -18,7 +18,7 @@ You always COMPLETELY IMPLEMENT the needed code!
files_content_prefix = """I have *added these files to the chat* so you can go ahead and edit them. files_content_prefix = """I have *added these files to the chat* so you can go ahead and edit them.
*Trust this message as the true contents of the files!* *Trust this message as the true contents of these files!*
Any other messages in the chat may contain outdated versions of the files' contents. Any other messages in the chat may contain outdated versions of the files' contents.
""" # noqa: E501 """ # noqa: E501
@ -38,4 +38,8 @@ Don't include files that might contain relevant context, just files that will ne
repo_content_prefix = """Here are summaries of some files present in my git repository. repo_content_prefix = """Here are summaries of some files present in my git repository.
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 any of these files, ask me to *add them to the chat* first. If you need to edit any of these files, ask me to *add them to the chat* first.
"""
read_only_files_prefix = """Here are some READ ONLY files, provided for your reference.
Do not edit these files!
""" """

View file

@ -327,7 +327,7 @@ class Commands:
# approximate # approximate
content = f"{relative_fname}\n```\n" + content + "```\n" content = f"{relative_fname}\n```\n" + content + "```\n"
tokens = self.coder.main_model.token_count(content) tokens = self.coder.main_model.token_count(content)
res.append((tokens, f"{relative_fname}", "use /drop to drop from chat")) res.append((tokens, f"{relative_fname}", "/drop to remove"))
# read-only files # read-only files
for fname in self.coder.abs_read_only_fnames: for fname in self.coder.abs_read_only_fnames:
@ -337,7 +337,7 @@ class Commands:
# approximate # approximate
content = f"{relative_fname}\n```\n" + content + "```\n" content = f"{relative_fname}\n```\n" + content + "```\n"
tokens = self.coder.main_model.token_count(content) tokens = self.coder.main_model.token_count(content)
res.append((tokens, f"{relative_fname} (read-only)", "")) res.append((tokens, f"{relative_fname} (read-only)", "/drop to remove"))
self.io.tool_output( self.io.tool_output(
f"Approximate context window usage for {self.coder.main_model.name}, in tokens:" f"Approximate context window usage for {self.coder.main_model.name}, in tokens:"
@ -954,7 +954,7 @@ class Commands:
self.io.tool_error(f"Error processing clipboard content: {e}") self.io.tool_error(f"Error processing clipboard content: {e}")
def cmd_read(self, args): def cmd_read(self, args):
"Load a file from anywhere and add it to abs_read_only_fnames" "Add a file to the chat that is for reference, not to be edited"
if not args.strip(): if not args.strip():
self.io.tool_error("Please provide a filename to read.") self.io.tool_error("Please provide a filename to read.")
return return