explain

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

internal/explain/explain.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, cfg Config) (string, error)

Run explains code in the configured mode using the runner.

Types

type Config

type Config struct {
	// file mode
	File   string
	Path   string
	Symbol string

	// diff mode
	Diff string
	Log  string
	Stat string

	Runner Runner
}

Config holds inputs for an explain run. File mode: set File and Path (Symbol optional). Diff mode: set Diff (Log and Stat optional). Exactly one mode must be active; Run returns an error otherwise.

type Runner

type Runner interface {
	Run(ctx context.Context, prompt string, tools []string) (string, error)
}

Runner is the port for LLM calls.

type RunnerFunc

type RunnerFunc func(ctx context.Context, prompt string, tools []string) (string, error)

RunnerFunc is a function adapter for Runner.

func (RunnerFunc) Run

func (f RunnerFunc) Run(ctx context.Context, prompt string, tools []string) (string, error)

Jump to

Keyboard shortcuts

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