ai

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 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 Client

type Client struct {
	// contains filtered or unexported fields
}

Client communicates with a local Ollama instance

func NewClient

func NewClient(endpoint, model string, timeout time.Duration) *Client

NewClient creates a new Ollama API client

func (*Client) Generate

func (c *Client) Generate(ctx context.Context, prompt string) (string, error)

Generate sends a prompt to Ollama and returns the response text

func (*Client) IsAvailable

func (c *Client) IsAvailable(ctx context.Context) bool

IsAvailable checks if the Ollama server is reachable and the model exists

type Config

type Config struct {
	Enabled  bool          `yaml:"enabled"`
	Endpoint string        `yaml:"endpoint,omitempty"` // Ollama API endpoint (default: http://localhost:11434)
	Model    string        `yaml:"model,omitempty"`    // Model name (default: llama3.2)
	Timeout  time.Duration `yaml:"timeout,omitempty"`  // Request timeout (default: 120s)
}

Config controls the AI enrichment behavior

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns an AI config with sensible defaults

func (*Config) Merge

func (c *Config) Merge()

Merge fills in missing values from defaults

type Enricher

type Enricher struct {
	// contains filtered or unexported fields
}

Enricher uses an AI model to generate additional insights about a codebase

func NewEnricher

func NewEnricher(cfg *Config) *Enricher

NewEnricher creates a new AI enricher

func (*Enricher) Enrich

func (e *Enricher) Enrich(ctx context.Context, analysis *types.Analysis) error

Enrich runs all enrichment prompts and attaches results to the analysis

func (*Enricher) IsAvailable

func (e *Enricher) IsAvailable(ctx context.Context) bool

IsAvailable checks if the AI backend is reachable

Jump to

Keyboard shortcuts

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