Skip to content

Commit

Permalink
fix: reorder system prompt and language prompt
Browse files Browse the repository at this point in the history
The system prompt and language prompt in the ChatHandler class have been reordered for better readability and consistency. The language prompt is now displayed first, followed by the system prompt.
  • Loading branch information
jellydn committed Feb 18, 2024
1 parent ea383a4 commit 0d474a1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion rplugin/python3/CopilotChat/handlers/chat_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,13 @@ def _construct_system_prompt(self, prompt: str):
elif prompt == system_prompts.EXPLAIN_SHORTCUT:
system_prompt = system_prompts.COPILOT_EXPLAIN
if self.language != "":
system_prompt = system_prompt + "\n" + system_prompts.PROMPT_ANSWER_LANGUAGE_TEMPLATE.substitute(language=self.language)
system_prompt = (
system_prompts.PROMPT_ANSWER_LANGUAGE_TEMPLATE.substitute(
language=self.language
)
+ "\n"
+ system_prompt
)
return system_prompt

def _add_start_separator(
Expand Down

0 comments on commit 0d474a1

Please sign in to comment.