Versions in this module Expand all Collapse all v1 v1.2.9 Oct 2, 2026 v1.2.8 Oct 2, 2026 v1.2.7 Oct 2, 2026 Changes in this version + const DefaultHealthTTL + const DefaultTimeout + const MaxBodyBytes + const MaxChoiceCriteria + const MaxQuestions + const MinChoiceCriteria + const OllamaPullHint + var ErrBadRequest = errors.New("systemone: bad request") + var ErrMalformed = ErrMalformedResponse + var ErrMalformedResponse = errors.New("systemone: malformed response") + var ErrModelNotFound = errors.New("systemone: model not found") + var ErrRateLimited = errors.New("systemone: rate limited") + var ErrServer = errors.New("systemone: server error") + var ErrTimeout = errors.New("systemone: timeout") + var ErrTooLarge = errors.New("systemone: request too large") + var ErrUnauthorized = errors.New("systemone: unauthorized") + var ErrUnavailable = errors.New("systemone: backend unavailable") + var ErrUnreachable = errors.New("systemone: backend unreachable") + var SuggestedOllamaModels = []string + func IsSuggestedOllamaModel(name string) bool + func MissingSuggestedOllamaModels(installed []string) []string + func Warmup(ctx context.Context, p DecisionProvider, model string) error + type APIError struct + Kind error + Message string + Status int + func (e *APIError) Error() string + func (e *APIError) Is(target error) bool + func (e *APIError) Unwrap() error + type Answer struct + Choice string + Confidence float64 + Probabilities map[string]float64 + Score *float64 + Type string + type Client struct + func NewClient(o Options) *Client + func (c *Client) BaseURL() string + func (c *Client) Decide(ctx context.Context, req Request) (*Response, error) + func (c *Client) DecideLenient(ctx context.Context, req Request) (*Response, error) + func (c *Client) KeepAlive() string + func (c *Client) Timeout() time.Duration + type Criterion struct + Description *string + Key string + func NewCriterion(key, description string) Criterion + type DecisionModel struct + Capabilities []string + ContextWindow int + ID string + Name string + type DecisionProvider interface + Client func() *Client + ContextBudget func(ctx context.Context, model string) int + Health func(ctx context.Context, model string) HealthReport + Kind func() ProviderKind + ListDecisionModels func(ctx context.Context, showAll bool) ([]DecisionModel, ListStatus, error) + func NewProvider(kind ProviderKind, o Options) (DecisionProvider, error) + type HealthCache struct + func NewHealthCache(ttl time.Duration) *HealthCache + func (h *HealthCache) Get(ctx context.Context, p DecisionProvider, model string) HealthReport + func (h *HealthCache) Invalidate() + type HealthReport struct + Authorized bool + IsDecision bool + Kind ProviderKind + LatencyMs int64 + Model string + ModelFound bool + OK bool + Problems []string + Reachable bool + Remote bool + Version string + VersionOK bool + type ListStatus string + const ListFiltered + const ListUnfiltered + const ListUnsupported + type Options struct + APIKey string + BaseURL string + ContextBudget int + HTTPClient *http.Client + Headers map[string]string + KeepAlive string + Timeout time.Duration + type ProviderKind string + const KindCustom + const KindOllama + const KindTypeSafe + type Question struct + Criteria []Criterion + Extra map[string]any + Instructions any + Type string + func (q Question) MarshalJSON() ([]byte, error) + type Request struct + KeepAlive string + Model string + Questions map[string]Question + State any + type Response struct + Answers map[string]Answer + Model string + Usage Usage + type Usage struct + Cost *float64 + InputTokens int + OutputTokens int