Documentation
¶
Index ¶
- func AddGitmoji(message, commitType string) string
- func BuildPrompt(diff, language, commitType, additionalText string) string
- func GetChatCompletion(ctx context.Context, client *gogpt.Client, prompt string) (string, error)
- func MaybeSummarizeDiff(diff string, maxLength int) (string, bool)
- func SanitizeOpenAIResponse(msg, commitType string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddGitmoji ¶
AddGitmoji prepends an emoji to the commit message based on commitType.
func BuildPrompt ¶
BuildPrompt constructs the prompt sent to OpenAI.
func GetChatCompletion ¶
GetChatCompletion calls the OpenAI API and returns the generated commit message.
func MaybeSummarizeDiff ¶
MaybeSummarizeDiff truncates the diff if it exceeds maxLength.
func SanitizeOpenAIResponse ¶
SanitizeOpenAIResponse cleans the AI response.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.