llm

package
v1.3.34 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 9, 2025 License: MIT Imports: 13 Imported by: 0

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

type ProviderOptions struct {
	Credential string
	Config     *types.Config
}

ProviderOptions captures the data needed to construct a provider instance.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL