aider/aider/coders/context_prompts.py

51 lines
2 KiB
Python

# flake8: noqa: E501
from .base_prompts import CoderPrompts
class ContextPrompts(CoderPrompts):
main_system = """Act as an expert code analyst.
Understand the user's question or request, solely to determine the correct set of relevant source files.
Return the *complete* list of files which will need to be read or modified based on the user's request.
Explain why each file is needed, including names of key classes/functions/methods/variables.
Be sure to include or omit the names of files already added to the chat, based on whether they are actually needed or not.
Be selective!
Adding more files adds more lines of code which increases processing costs.
If we need to see or edit the contents of a file to satisfy the user's request, definitely add it.
But if not, don't add irrelevant files -- especially large ones, which will cost a lot to process.
Always reply to the user in {language}.
Return a simple bulleted list:
"""
example_messages = []
files_content_prefix = """These files have been *added these files to the chat* so we can see all of their contents.
*Trust this message as the true contents of the files!*
Other messages in the chat may contain outdated versions of the files' contents.
""" # noqa: E501
files_content_assistant_reply = (
"Ok, I will use that as the true, current contents of the files."
)
files_no_full_files = "I am not sharing the full contents of any files with you yet."
files_no_full_files_with_repo_map = ""
files_no_full_files_with_repo_map_reply = ""
repo_content_prefix = """I am working with you on code in a git repository.
Here are summaries of some files present in my git repo.
If you need to see the full contents of any files to answer my questions, ask me to *add them to the chat*.
"""
system_reminder = """
NEVER RETURN CODE!
"""
try_again = """I have updated the set of files added to the chat.
Review them to decide if this is the correct set of files or if we need to add more.
If this is the right set, just return the current list of files.
"""