@@ -188,9 +188,8 @@ def get_personality_prompt():
188
188
189
189
EXPERT_SOFTWARE_ENGINEER = """
190
190
You are an expert software engineer, versed in many programming languages,
191
- especially Python . You follow software development best practices and you know how to
191
+ especially {languages} . You follow software development best practices and you know how to
192
192
write clean, maintainable code. You are a champion for code quality.
193
- You are terse and to the point.
194
193
You know how to give constructive feedback that is actionable, kind, and specific.
195
194
"""
196
195
@@ -276,14 +275,15 @@ def generate_files_context(files):
276
275
END DIFF
277
276
278
277
Instructions for the commit message:
279
- * Start with a short summary (< 72 characters).
278
+ * Start with a short summary (less than 72 characters).
280
279
* Follow with a blank line and detailed text, but only if necessary. If the summary is sufficient,
281
280
then omit the detailed text.
282
281
* Use imperative mood (e.g., "Add feature").
283
282
* Be in GitHub-flavored markdown format.
284
- * Include contextually appropriate emojis (optional), but don't over do it.
285
283
* Have a length that scales with the length of the diff context. If the DIFF is a small change,
286
284
respond quickly with a terse message so we can go faster.
285
+ * Do not repeat information that is already known from the git commit.
286
+ * Be terse.
287
287
288
288
BEGIN SAMPLE COMMIT MESSAGE
289
289
Update README with better instructions for installation
@@ -293,8 +293,9 @@ def generate_files_context(files):
293
293
new users get started faster.
294
294
END SAMPLE COMMIT MESSAGE
295
295
296
+ Formatting instructions:
296
297
Start your response with the commit message. No prefix or introduction.
297
- Your entire response will be the commit message.
298
+ Your entire response will be the commit message. No quotation marks.
298
299
"""
299
300
)
300
301
@@ -355,7 +356,7 @@ def generate_files_context(files):
355
356
* "COMMENTS" - there were some issues found, but they should not block the build and are informational only
356
357
* "FAILED" - there were serious, blocking issues found that should be fixed before merging the code
357
358
358
- The review message should be a markdown-formatted string for display with rich.Markdown or GitHub markdown.
359
+ The review message should be a markdown-formatted string for display with GitHub markdown.
359
360
"""
360
361
)
361
362
@@ -368,24 +369,24 @@ def get_prompt(command, structured_output=False):
368
369
parser = PydanticOutputParser (pydantic_object = ReviewResult )
369
370
return PromptTemplate (
370
371
template = REVIEW_TEMPLATE + "\n {format_instructions}" ,
371
- input_variables = ["diff_context" ],
372
+ input_variables = ["diff_context" , "languages" ],
372
373
partial_variables = {"format_instructions" : parser .get_format_instructions ()},
373
374
output_parser = parser ,
374
375
)
375
376
else :
376
377
return PromptTemplate (
377
378
template = REVIEW_TEMPLATE + "\n Respond in markdown format" ,
378
- input_variables = ["diff_context" ],
379
+ input_variables = ["diff_context" , "languages" ],
379
380
)
380
381
381
382
else :
382
383
prompt_map = {
383
384
"alignment" : PromptTemplate (template = ALIGNMENT_TEMPLATE , input_variables = []),
384
- "commit" : PromptTemplate (template = COMMIT_TEMPLATE , input_variables = ["diff_context" ]),
385
- "debug" : PromptTemplate (template = DEBUG_TEMPLATE , input_variables = ["command_output" ]),
385
+ "commit" : PromptTemplate (template = COMMIT_TEMPLATE , input_variables = ["diff_context" , "languages" ]),
386
+ "debug" : PromptTemplate (template = DEBUG_TEMPLATE , input_variables = ["command_output" , "languages" ]),
386
387
"fun_fact" : PromptTemplate (template = FUN_FACT_TEMPLATE , input_variables = ["topic" ]),
387
388
"sidekick" : PromptTemplate (
388
- template = SIDEKICK_TEMPLATE , input_variables = ["chat_history" , "task" , "context" ]
389
+ template = SIDEKICK_TEMPLATE , input_variables = ["chat_history" , "task" , "context" , "languages" ]
389
390
),
390
391
}
391
392
0 commit comments