advisor

package
v0.27.1 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const Help = `` /* 293-byte string literal not displayed */

Help explains how to turn the optional layer on, for the message printed when a suggestion is asked for and nothing is configured.

Variables

View Source
var ErrAdvisor = errors.New("advisor")

ErrAdvisor marks a failure inside the optional model layer. Nothing in the verification engine depends on it: an advisor error stops a suggestion, it never changes a pass or a fail.

Functions

func FirstJSONObject

func FirstJSONObject(s string) (string, error)

FirstJSONObject returns the first balanced top-level JSON object or array in a reply, so a model that wraps its answer in prose or a fenced block still parses. Braces inside strings are ignored.

Types

type Advisor

type Advisor interface {
	// Chat sends the system and user prompts and returns the reply text.
	Chat(ctx context.Context, system, user string) (string, error)
}

Advisor answers one prompt. It is the whole of kibble's optional model layer, and it is never consulted while deciding whether a documented step passed. It only proposes a .kibble.yml for a human to read and commit, so a run with no advisor configured verifies exactly as much as one with it.

func NewAdvisor

func NewAdvisor() (Advisor, bool)

NewAdvisor returns the advisor the environment configures, and reports whether one is available. Providers are checked in a fixed order so the choice is reproducible: an explicit KIBBLE_ADVISOR wins, then Anthropic, then OpenAI, then a local Ollama. No advisor is a normal state, not an error, because kibble is fully useful without one.

type AdvisorFunc

type AdvisorFunc func(ctx context.Context, system, user string) (string, error)

AdvisorFunc adapts a function to the Advisor interface.

func (AdvisorFunc) Chat

func (f AdvisorFunc) Chat(ctx context.Context, system, user string) (string, error)

Chat calls f.

Jump to

Keyboard shortcuts

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