enhance: improve AI commit message generation instructions and tool descriptions

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo
2026-03-27 11:21:31 +08:00
parent 86a385d865
commit 03ab1afff3
2 changed files with 3 additions and 3 deletions

View File

@@ -29,11 +29,11 @@ namespace SourceGit.AI
var userMessageBuilder = new StringBuilder();
userMessageBuilder
.AppendLine("Generate a commit message (follow the rule of conventional commit message) for given git repository.")
.AppendLine("- Read all given changed files before generating. Do not skip any one file.")
.AppendLine("- Read all given changed files before generating. Only binary files (such as images, audios ...) can be skipped.")
.AppendLine("- Output the conventional commit message (with detail changes in list) directly. Do not explain your output nor introduce your answer.")
.AppendLine(string.IsNullOrEmpty(_service.AdditionalPrompt) ? string.Empty : _service.AdditionalPrompt)
.Append("Reposiory path: ").AppendLine(repo.Quoted())
.AppendLine("Changed files: ")
.AppendLine("Changed files ('A' means added, 'M' means modified, 'D' means deleted, 'T' means type changed, 'R' means renamed, 'C' means copied): ")
.Append(changeList);
var messages = new List<ChatMessage>() { new UserChatMessage(userMessageBuilder.ToString()) };

View File

@@ -25,7 +25,7 @@ namespace SourceGit.AI
},
"originalFile": {
"type": "string",
"description": "The path to the original file when it has been renamed (marked as 'R' or 'C')."
"description": "The path to the original file when it has been renamed or copied."
}
},
"required": ["repo", "file"]