From 444d17de9377f0f4bfa1373f527c1b1826381a14 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Thu, 9 May 2024 11:27:13 -0700 Subject: [PATCH] reverted prompt closer to e9da401, added helpful assistant replies to repo and files messages --- aider/coders/base_coder.py | 10 ++++++++-- aider/coders/base_prompts.py | 6 ++---- aider/coders/editblock_prompts.py | 4 ++-- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/aider/coders/base_coder.py b/aider/coders/base_coder.py index 1a49d61c0..8f0a93984 100755 --- a/aider/coders/base_coder.py +++ b/aider/coders/base_coder.py @@ -423,7 +423,10 @@ class Coder: if repo_content: files_messages += [ dict(role="user", content=repo_content), - dict(role="assistant", content="Ok."), + dict( + role="assistant", + content="Ok, I won't try and edit those files without asking first.", + ), ] if self.abs_fnames: @@ -434,7 +437,10 @@ class Coder: files_messages += [ dict(role="user", content=files_content), - dict(role="assistant", content="Ok."), + dict( + role="assistant", + content="Ok, I will propose edits to those files to complete your request.", + ), ] images_message = self.get_images_message() diff --git a/aider/coders/base_prompts.py b/aider/coders/base_prompts.py index ee0136822..0cec0fe9a 100644 --- a/aider/coders/base_prompts.py +++ b/aider/coders/base_prompts.py @@ -20,9 +20,7 @@ You always COMPLETELY IMPLEMENT the needed code! files_no_full_files = "I am not sharing any files that you can edit yet." - 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. + 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*. -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. +If you need to edit any of these files, ask me to *add them to the chat* first. """ diff --git a/aider/coders/editblock_prompts.py b/aider/coders/editblock_prompts.py index b4392d318..14309b398 100644 --- a/aider/coders/editblock_prompts.py +++ b/aider/coders/editblock_prompts.py @@ -12,7 +12,7 @@ Take requests for changes to the supplied code. If the request is ambiguous, ask questions. Once you understand the request you MUST: -1. List the files you need to modify. Only suggest changes to files that the user has given you permission to edit. +1. List the files you need to modify. Only suggest changes to files that the users says you can edit. Before changing other files, you *MUST* tell the user their full path names and ask them to *add the files to the chat*. End your reply and wait for their approval. 2. Think step-by-step and explain the needed changes with a numbered list of short sentences. 3. Describe each change with a *SEARCH/REPLACE block* per the examples below. All changes to files must use this *SEARCH/REPLACE block* format. ONLY EVER RETURN CODE IN A *SEARCH/REPLACE BLOCK*! @@ -124,7 +124,7 @@ Every *SEARCH* section must *EXACTLY MATCH* the existing source code, character Include *ALL* the code being searched and replaced! -Only *SEARCH/REPLACE* files that the user has given you permission to edit. +Only *SEARCH/REPLACE* files that the user says you can edit. To move code within a file, use 2 *SEARCH/REPLACE* blocks: 1 to delete it from its current location, 1 to insert it in the new location.