settings

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package settings describes persistent user settings and resolves their inherited defaults.

Index

Constants

View Source
const ContextWindowTokens = "inference.context.window_tokens"

ContextWindowTokens is the session history window setting, measured in tokens.

View Source
const DefaultOutputTokens = "8284"

DefaultOutputTokens is the inherited generation cap.

View Source
const FallbackContextTokens = 131072

FallbackContextTokens bounds history when the backend reports no model context limit.

View Source
const MaxOutputTokens = "inference.generation.max_output_tokens"

MaxOutputTokens is the per-request generation limit, measured in tokens.

View Source
const Model = "inference.model"

Model is the selected inference model.

View Source
const PermissionPolicy = "execution.permissions.policy"

PermissionPolicy is the tool approval policy selection.

View Source
const ReasoningEffort = "inference.reasoning.effort"

ReasoningEffort is the requested reasoning effort.

Variables

This section is empty.

Functions

func Canonical

func Canonical(key string) string

Canonical returns the public name of a setting, preserving unknown names.

func ContextBudget

func ContextBudget(requested, chain, model int) int

ContextBudget bounds a requested window by positive chain and model limits.

func Environment

func Environment(key string) (string, string)

Environment returns a supported environment override and its variable name.

func Fallback

func Fallback(key string) string

Fallback returns the concrete inherited default where the setting has one.

func IsCommon

func IsCommon(key string) bool

IsCommon identifies the settings shown in the default list.

func Name

func Name(key string) string

Name returns the human-readable label for a setting.

func StorageKey

func StorageKey(key string) string

StorageKey maps aliases to one existing database row.

Types

type Spec

type Spec struct {
	Key     string `json:"key"`
	Label   string `json:"label"`
	Meaning string `json:"meaning"`
	Changes string `json:"effect"`
	ReadBy  string `json:"read_by"`
	Env     string `json:"environment_variable"`
	Unset   string `json:"unset_behavior"`
}

Spec describes a setting independently of its storage and presentation.

func All

func All() []Spec

All returns the setting definitions sorted by public name.

func Lookup

func Lookup(key string) (Spec, bool)

Lookup accepts a canonical name or a legacy storage name.

type Value

type Value struct {
	Key    string `json:"key"`
	Value  string `json:"value"`
	Source string `json:"source"`
	Stored string `json:"stored,omitempty"`
	Scope  string `json:"scope"`
}

Value records a resolved default and its provenance, before agent and model limits.

func Resolve

func Resolve(key, stored, scope, fallback string, override *string) Value

Resolve applies an explicit invocation override, environment, stored value, then fallback.

Jump to

Keyboard shortcuts

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