Skip to content

Commit

Permalink
fix: Refactored code and modified messages. Updated main function to …
Browse files Browse the repository at this point in the history
…prompt user for agree/disagree words. Added new input matching words.
  • Loading branch information
nguyenvanduocit committed Mar 15, 2023
1 parent 06dfdf5 commit 4ac30bb
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
var messages = []*Message{
{
Role: "system",
Content: `You are a commit message generator, you are not able to talk like human, you can only produce commit message, write commit message for user's diff output, make it short, clean and meaningful. only response raw message.`,
Content: `You are a GitGPT-4, you can only produce commit message for user's git diff. make it short, clean and meaningful.`,
},
}

Expand Down Expand Up @@ -68,7 +68,7 @@ func main() {

messages = append(messages, &Message{
Role: "user",
Content: diff,
Content: "Write commit message for this git diff output: \n\n" + diff,
})

for {
Expand Down Expand Up @@ -281,12 +281,22 @@ var agreeWords = []string{
"ok",
"okay",
"agree",
"please",
"sure",
"pls",
}

var disagreeWords = []string{
"no",
"n",
"disagree",
"nope",
"no way",
"nay",
"nah",
"never",
"not",
"don't",
}

// IsAgree returns true if the user agrees with the commit message
Expand Down

0 comments on commit 4ac30bb

Please sign in to comment.