Documentation
¶
Index ¶
Constants ¶
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 ¶
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 ¶
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 ¶
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.