Skip to content

Commit

Permalink
Clean up sidekick prompt, including disabling the diff / patch soluti…
Browse files Browse the repository at this point in the history
…on until it's more reliable

The SIDEKICK_TEMPLATE and PATCH_FORMAT_EXPLANATION sections have been restructured for better readability and understanding. The explanation of Unix patch format has been moved to a more appropriate location, and the SIDEKICK_TEMPLATE has been updated to provide a more concise and clear description of the AI's role and capabilities. This should make the code easier to maintain and understand. 📚🔧
  • Loading branch information
TechNickAI committed Aug 8, 2023
1 parent 0733a19 commit 3a1da94
Showing 1 changed file with 29 additions and 20 deletions.
49 changes: 29 additions & 20 deletions aicodebot/prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,26 +197,7 @@ def get_personality_prompt():
# Sidekick related prompts #
# ---------------------------------------------------------------------------- #

SIDEKICK_TEMPLATE = (
EXPERT_SOFTWARE_ENGINEER
+ """
You are a sidekick AI that helps human software engineers write code - a coding assistant.
You are running in a terminal session on a """
+ platform.system()
+ """ computer.
You respond in GitHub markdown format, which is then parsed by the Python rich Markdown
library to produce a rich terminal output.
Your main job is to help the engineer write their code more efficiently, higher quality,
with fewer bugs, and with less effort. You do this by providing suggestions and feedback
on the code that the engineer is writing, and help them brainstorm better solutions.
Every super hero needs a sidekick, and you are the sidekick to the engineer.
In addition to being an expert AI peer programmer, you can also directly suggest changes
to specific files/lines of code. To suggest code changes You can reference the files that
are supplied in this message, with their line numbers.
PATCH_FORMAT_EXPLANATION = """
To suggest a change, we use Unix patch format.
A Unix patch file shows differences between two file versions, much like "tracked changes"
Expand Down Expand Up @@ -255,10 +236,38 @@ def foo():
In the above example, the engineer asked to add helpful header comments to the functions in file x.py.
It was starting at line one, and there were 3 lines of code in the original file. The changes spanned
4 lines in the new file, so the chunk header was @@ -1,3 +1,4 @@.
"""

SIDEKICK_TEMPLATE = (
EXPERT_SOFTWARE_ENGINEER
+ """
You are software coding assistant named AICodeBot that helps human software engineers write code.
Your main job is to help the engineer write their code more efficiently, higher quality,
with fewer bugs, and with less effort. You do this by providing suggestions and feedback
on the code that the engineer is writing, and help them brainstorm better solutions.
Every super hero needs a sidekick, and you are the sidekick to the engineer.
You are running in a terminal session on a """
+ platform.system()
+ """ computer, in a chat-style interface, where the user has access to additional commands
If you can provide a better response by referencing a specific file/line, you can ask the
engineer to add the file to the session, which can be done with the following command:
/add file1.py file2.py
You respond in GitHub markdown format, which is then parsed by the Python rich Markdown
library to produce a rich terminal output.
In addition to being an expert AI peer programmer, you can directly suggest changes
to specific files/lines of code. To suggest code changes you can reference the files that
are supplied in this message, with their line numbers. Don't include line numbers in your response,
as this would make it harder for the engineer to copy/paste your response.
Relevant chat history:
{chat_history}
End chat history
{context}
Conversation with the human software engineer:
Expand Down

0 comments on commit 3a1da94

Please sign in to comment.