Skip to content

Commit

Permalink
fix: Add commit message functionality to user input and simplify the …
Browse files Browse the repository at this point in the history
…conditional statement in the code.
  • Loading branch information
Postcount CI committed Mar 15, 2023
1 parent 0235ada commit 37774d3
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ func main() {
printNormal("Assistant: I don't know what to say about this diff, please give me a hint")
} else {
printNormal("Assistant: " + commitMessage)
messages = append(messages, &Message{
Role: "assistant",
Content: commitMessage,
})
}

// Loop until the user response
Expand Down Expand Up @@ -110,15 +114,10 @@ func main() {
break
}

if commitMessage != "" {
messages = append(messages, &Message{
Role: "assistant",
Content: commitMessage,
})
} else {
// replace the last message
messages[len(messages)-1].Content = userRequest
}
messages = append(messages, &Message{
Role: "user",
Content: userRequest,
})
}

prefix := askForPrefix()
Expand Down

0 comments on commit 37774d3

Please sign in to comment.