Skip to content

Commit a39d261

Browse files
committed
enhance: improve AI commit message generation instructions and tool descriptions
Signed-off-by: leo <longshuang@msn.cn>
1 parent 86a385d commit a39d261

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/AI/Agent.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ public async Task GenerateCommitMessageAsync(string repo, string changeList, Act
2929
var userMessageBuilder = new StringBuilder();
3030
userMessageBuilder
3131
.AppendLine("Generate a commit message (follow the rule of conventional commit message) for given git repository.")
32-
.AppendLine("- Read all given changed files before generating. Do not skip any one file.")
32+
.AppendLine("- Read all given changed files before generating. Only binary files (such as images, audios, .etc.) can be skipped.")
3333
.AppendLine("- Output the conventional commit message (with detail changes in list) directly. Do not explain your output nor introduce your answer.")
3434
.AppendLine(string.IsNullOrEmpty(_service.AdditionalPrompt) ? string.Empty : _service.AdditionalPrompt)
3535
.Append("Reposiory path: ").AppendLine(repo.Quoted())
36-
.AppendLine("Changed files: ")
36+
.AppendLine("Changed files ('A' means added, 'M' means modified, 'D' means deleted, 'T' means type changed, 'R' means renamed, 'C' means copied): ")
3737
.Append(changeList);
3838

3939
var messages = new List<ChatMessage>() { new UserChatMessage(userMessageBuilder.ToString()) };

src/AI/ChatTools.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public static class ChatTools
2525
},
2626
"originalFile": {
2727
"type": "string",
28-
"description": "The path to the original file when it has been renamed (marked as 'R' or 'C')."
28+
"description": "The path to the original file when it has been renamed or copied."
2929
}
3030
},
3131
"required": ["repo", "file"]

0 commit comments

Comments
 (0)