enrich

package
v3.15.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Input

type Input struct {
	RepoDir     string           // root of the git repository (working dir for git log)
	RecordFiles []string         // paths to draft blueprint records to enrich
	APIKey      string           // LLM API key; falls back to OPENAI_API_KEY or ANTHROPIC_API_KEY env vars
	Provider    string           // "openai" or "anthropic"; auto-detected from env vars if empty
	Model       string           // optional model override; sensible defaults per provider
	LLMBaseURL  string           // optional base URL for local LLMs (e.g., http://localhost:1234); provider path appended automatically
	Progress    func(msg string) // optional; called at each stage per record for progress reporting
}

Input holds everything needed to run git history enrichment on a set of draft records.

type Result

type Result struct {
	RecordFilePath string
	Intent         string
	Skipped        bool  // no commits found or no LLM configured
	Err            error // non-fatal; caller logs and continues
}

Result is the outcome of enriching one record.

func Enrich

func Enrich(in Input) ([]Result, error)

Enrich collects git commit history for each record's affected_scope files, synthesizes an intent summary via LLM, and updates each record's intent field in place. Per-record errors are captured in Result.Err rather than returned; the error return is reserved for structural failures that prevent any enrichment.

func EnrichWithBaseURL

func EnrichWithBaseURL(in Input, baseURL string) ([]Result, error)

EnrichWithBaseURL is like Enrich but uses baseURL as the LLM API endpoint instead of the provider default. Pass an empty string to use the real endpoint. Exposed for tests.

Jump to

Keyboard shortcuts

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