setup

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Probe

func Probe(ctx context.Context, model, apiKey, baseURL string) error

Probe makes a cheap, token-free connectivity check against the endpoint by listing models. It returns nil if the endpoint responds, or a descriptive error otherwise. A short timeout keeps the wizard responsive. The model argument is accepted for signature stability but not needed by ListModels.

func Run

func Run(ctx context.Context, existing types.Config) (types.Config, bool, error)

Run launches the interactive wizard. It returns the resulting config, whether it was saved, and any fatal error. Cancellation (Esc/Ctrl+C) returns saved=false with a nil error and the unchanged existing config.

func Save

func Save(cfg types.Config) (string, error)

Save writes the LLM connection fields (model, api_key, base_url) into <configDir>/config.yaml, preserving any keys that already exist in the file. It returns the path written. The file uses mode 0600 because it holds a key.

Types

type Preset

type Preset struct {
	Name         string // display name shown in the picker
	BaseURL      string // prefilled, editable; "" means the OpenAI SDK default
	DefaultModel string // prefilled model field
	DefaultKey   string // prefilled api_key
	KeyRequired  bool   // informational hint only; never blocks saving
}

Preset is a provider template that prefills connection fields in the wizard.

func Presets

func Presets() []Preset

Presets returns the built-in provider presets, in display order.

Jump to

Keyboard shortcuts

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