Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var CommitPrompt = `` /* 762-byte string literal not displayed */
CommitPrompt is the base instruction template sent to LLM providers before appending repository changes and optional style guidance.
Functions ¶
func BuildCommitPrompt ¶ added in v1.3.23
func BuildCommitPrompt(changes string, opts *GenerationOptions) string
BuildCommitPrompt constructs the prompt that will be sent to the LLM, applying any optional tone/style instructions before appending the repository changes.
func GetSupportedProviderStrings ¶ added in v1.3.22
func GetSupportedProviderStrings() []string
GetSupportedProviderStrings returns the human-friendly names for providers.
Types ¶
type Choice ¶
type Choice struct {
Message Message `json:"message"`
Index int `json:"index"`
FinishReason string `json:"finish_reason"`
}
Choice details a single response option returned by Grok.
type Config ¶
type Config struct {
GrokAPI string `json:"grok_api"`
Repos map[string]RepoConfig `json:"repos"`
}
Config stores CLI-level configuration including named repositories.
type GenerationOptions ¶ added in v1.3.23
type GenerationOptions struct {
// StyleInstruction contains optional tone/style guidance appended to the base prompt.
StyleInstruction string
// Attempt records the 1-indexed attempt number for this generation request.
// Attempt > 1 signals that the LLM should provide an alternative output.
Attempt int
}
GenerationOptions controls how commit messages should be produced by LLM providers.
type GrokRequest ¶
type GrokRequest struct {
Messages []Message `json:"messages"`
Model string `json:"model"`
Stream bool `json:"stream"`
Temperature float64 `json:"temperature"`
}
GrokRequest represents a chat completion request sent to X.AI's API.
type GrokResponse ¶
type GrokResponse struct {
Message Message `json:"message,omitempty"`
Choices []Choice `json:"choices,omitempty"`
Id string `json:"id,omitempty"`
Object string `json:"object,omitempty"`
Created int64 `json:"created,omitempty"`
Model string `json:"model,omitempty"`
Usage UsageInfo `json:"usage,omitempty"`
}
GrokResponse contains the relevant fields parsed from X.AI responses.
type LLMProvider ¶ added in v1.3.22
type LLMProvider string
LLMProvider identifies the large language model backend used to author commit messages.
const ( ProviderOpenAI LLMProvider = "OpenAI" ProviderClaude LLMProvider = "Claude" ProviderGemini LLMProvider = "Gemini" ProviderGrok LLMProvider = "Grok" ProviderGroq LLMProvider = "Groq" ProviderOllama LLMProvider = "Ollama" )
func GetSupportedProviders ¶ added in v1.3.22
func GetSupportedProviders() []LLMProvider
GetSupportedProviders returns all available provider enums.
func ParseLLMProvider ¶ added in v1.3.22
func ParseLLMProvider(s string) (LLMProvider, bool)
ParseLLMProvider converts a string into an LLMProvider enum when supported.
func (LLMProvider) IsValid ¶ added in v1.3.22
func (p LLMProvider) IsValid() bool
IsValid reports whether the provider is part of the supported set.
func (LLMProvider) String ¶ added in v1.3.22
func (p LLMProvider) String() string
String returns the provider identifier as a plain string.
type RepoConfig ¶
RepoConfig tracks metadata for a configured Git repository.