Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrMissingCredential = errors.New("llm: missing credential")
ErrMissingCredential signals that a provider requires a credential such as an API key or URL.
Functions ¶
func RegisterFactory ¶
func RegisterFactory(name types.LLMProvider, factory Factory)
RegisterFactory allows callers (primarily tests) to override or extend provider creation logic.
Types ¶
type Factory ¶
type Factory func(ProviderOptions) (Provider, error)
Factory describes a function capable of building a Provider.
type Provider ¶
type Provider interface {
// Name returns the LLM provider identifier this instance represents.
Name() types.LLMProvider
// Generate requests a commit message for the supplied repository changes.
Generate(ctx context.Context, changes string, opts *types.GenerationOptions) (string, error)
}
Provider declares the behaviour required by commit-msg to talk to an LLM backend.
func NewProvider ¶
func NewProvider(name types.LLMProvider, opts ProviderOptions) (Provider, error)
NewProvider returns a concrete Provider implementation for the requested name.
type ProviderOptions ¶
ProviderOptions captures the data needed to construct a provider instance.
Click to show internal directories.
Click to hide internal directories.