Skip to content

Commit 7b07271

Browse files
committed
fix(llm): update prompt guidelines for commit message generation
- Clarify the use of `build` and `docs` in the prompt - Emphasize not using `docs` for script or code changes [Generated by Kommit]
1 parent cd0116a commit 7b07271

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

internal/llm/openai.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ func chatStructured[T any](model, prompt string, schema openai.ResponseFormatJSO
114114

115115
func GenerateCommitMessage(model, context, diff string) (string, error) {
116116
// main prompt
117-
prompt := "Generate a conventional commit message"
117+
prompt := "Generate a single commit message in the conventional commit message format"
118118

119119
// constraints
120120
prompt += ", without:\n"
@@ -126,8 +126,9 @@ func GenerateCommitMessage(model, context, diff string) (string, error) {
126126
// type
127127
prompt += "\nUsing conventional commit types:\n"
128128
prompt += "- in lowercase\n"
129-
prompt += "- using build: for build system, scripts or settings, such as Makefile, Dockerfile, etc.\n"
130-
prompt += "- using docs: for documentation only changes\n"
129+
prompt += "- Use `build` for build system, scripts or settings, such as Makefile, Dockerfile, etc.\n"
130+
prompt += "- Use `docs` for changes to the documentation, such as README, CHANGELOG, etc.\n"
131+
prompt += "- Do not use `docs` for changes to scripts or code\n"
131132

132133
// scope
133134
prompt += "\nUsing conventional commit scopes:\n"

0 commit comments

Comments
 (0)