You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"default": "Now, please generate a commit message. Ensure that it includes a precise and informative subject line that succinctly summarizes the crux of the changes in under 50 characters. If necessary, follow with an explanatory body providing insight into the nature of the changes, the reasoning behind them, and any significant consequences or considerations arising from them. Conclude with any relevant issue references at the end of the message.",
3535
-
"markdownDescription": "Specifies the prompt to use to tell OpenAI how to structure or format the generated commit message",
3535
+
"markdownDescription": "Specifies the prompt to use to tell the AI provider how to structure or format the generated commit message",
"default": "Now, please generate a commit message. Ensure that it includes a precise and informative subject line that succinctly summarizes the crux of the changes in under 50 characters. If necessary, follow with an explanatory body providing insight into the nature of the changes, the reasoning behind them, and any significant consequences or considerations arising from them. Conclude with any relevant issue references at the end of the message.",
3542
+
"markdownDescription": "Specifies the prompt to use to tell the AI provider how to structure or format the generated title and description",
constsystemPrompt=`You are an advanced AI programming assistant tasked with summarizing code changes into a concise and meaningful commit message. Compose a commit message that:
91
-
- Strictly synthesizes meaningful information from the provided code diff
92
-
- Utilizes any additional user-provided context to comprehend the rationale behind the code changes
93
-
- Is clear and brief, with an informal yet professional tone, and without superfluous descriptions
94
-
- Avoids unnecessary phrases such as "this commit", "this change", and the like
95
-
- Avoids direct mention of specific code identifiers, names, or file names, unless they are crucial for understanding the purpose of the changes
96
-
- Most importantly emphasizes the 'why' of the change, its benefits, or the problem it addresses rather than only the 'what' that changed
97
-
98
-
Follow the user's instructions carefully, don't repeat yourself, don't include the code in the output, or make anything up!`;
99
-
100
91
try{
101
92
letresult: string;
102
93
letmaxCodeCharacters: number;
@@ -107,12 +98,12 @@ Follow the user's instructions carefully, don't repeat yourself, don't include t
107
98
apiKey,
108
99
max=>{
109
100
constcode=diff.substring(0,max);
110
-
letprompt=`\n\nHuman: ${systemPrompt}\n\nHuman: Here is the code diff to use to generate the commit message:\n\n${code}\n`;
101
+
letprompt=`\n\nHuman: ${promptConfig.systemPrompt}\n\nHuman: Here is the code diff to use to generate the ${promptConfig.contextName}:\n\n${code}\n`;
111
102
if(options?.context){
112
-
prompt+=`\nHuman: Here is additional context which should be taken into account when generating the commit message:\n\n${options.context}\n`;
103
+
prompt+=`\nHuman: Here is additional context which should be taken into account when generating the ${promptConfig.contextName}:\n\n${options.context}\n`;
0 commit comments