Documentation
¶
Overview ¶
Package llm implements the LLM port using Ollama as the backend.
Index ¶
- type Adapter
- func (o *Adapter) ClearRetryContext()
- func (o *Adapter) DecideCommit(instruction, gitStatus, untracked, modified, deleted string) (domain.CommitIntent, error)
- func (o *Adapter) DetectSecrets(files []string) ([]domain.SecretDetection, error)
- func (o *Adapter) EnsureOllama() (bool, error)
- func (o *Adapter) GenerateChangelog(commits, previousChangelog, outputFile string) (string, error)
- func (o *Adapter) GenerateChunkMessage(chunk domain.DiffChunk) (string, error)
- func (o *Adapter) InterpretGitOp(op, instruction string, context map[string]string) (map[string]string, error)
- func (o *Adapter) InterpretReleaseIntent(instruction, releases, branches, currentBranch string) (*domain.ReleaseIntent, error)
- func (o *Adapter) IsAvailable() bool
- func (o *Adapter) PolishChangelog(chunks []string) (string, error)
- func (o *Adapter) PreWarm() error
- func (o *Adapter) ResolveModel() error
- func (o *Adapter) SetRetryContext(previousMessage string)
- func (o *Adapter) Stop()
- func (o *Adapter) VerifySecrets(diff string, findings []domain.SecretDetection) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
Adapter implements ports.LLM via Ollama.
func (*Adapter) ClearRetryContext ¶
func (o *Adapter) ClearRetryContext()
ClearRetryContext clears the retry context after commit or abort.
func (*Adapter) DecideCommit ¶
func (o *Adapter) DecideCommit(instruction, gitStatus, untracked, modified, deleted string) (domain.CommitIntent, error)
DecideCommit asks the LLM what files to stage based on instruction and git status.
func (*Adapter) DetectSecrets ¶
func (o *Adapter) DetectSecrets(files []string) ([]domain.SecretDetection, error)
DetectSecrets checks files for secrets using regex patterns.
func (*Adapter) EnsureOllama ¶
EnsureOllama starts Ollama if not running. Returns true if started by us.
func (*Adapter) GenerateChangelog ¶
GenerateChangelog generates changelog from commits and returns it.
func (*Adapter) GenerateChunkMessage ¶
GenerateChunkMessage generates a commit message for a single diff chunk.
func (*Adapter) InterpretGitOp ¶
func (o *Adapter) InterpretGitOp(op, instruction string, context map[string]string) (map[string]string, error)
InterpretGitOp interprets a natural language instruction for a git operation. Returns concrete args as a map (e.g. {"branch": "feat/login"}).
func (*Adapter) InterpretReleaseIntent ¶
func (o *Adapter) InterpretReleaseIntent(instruction, releases, branches, currentBranch string) (*domain.ReleaseIntent, error)
InterpretReleaseIntent interprets user's release intent.
func (*Adapter) IsAvailable ¶
IsAvailable checks if Ollama is reachable.
func (*Adapter) PolishChangelog ¶
PolishChangelog polishes the final changelog from chunks.
func (*Adapter) ResolveModel ¶
ResolveModel checks if the configured model is available; falls back to first available.
func (*Adapter) SetRetryContext ¶
SetRetryContext stores the previous rejected message for retry flow.
func (*Adapter) Stop ¶
func (o *Adapter) Stop()
Stop leaves Ollama running for next use (no kill on shutdown).
func (*Adapter) VerifySecrets ¶
VerifySecrets uses the LLM to verify if regex findings are real secrets.