Help us shape the future of Go! Take the 2026 Go Developer Survey

defaults

package
v0.2.7 Latest Latest
Warning

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

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

Documentation

Overview

Package defaults is what runs when the caller supplies nothing: one no-op or built-in implementation per optional interface, so no other package has to check for nil.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiscardLogger

func DiscardLogger() *slog.Logger

DiscardLogger drops every record.

func IsTransientLLMError

func IsTransientLLMError(err error) bool

IsTransientLLMError reports true for an iteration deadline, EOF, an empty reply, an idle stream and a reset connection.

Types

type Classifier

type Classifier struct{}

Classifier is the built-in retry classifier. Implements modelcall.ErrorClassifier.

func (Classifier) IsTransient

func (Classifier) IsTransient(err error) bool

type FullHistory

type FullHistory struct{}

FullHistory sends the whole history to the model. Implements engine.HistoryCompactor.

func (FullHistory) Compact

func (FullHistory) Compact(msgs []*schema.Message) []*schema.Message

type NoIdentity

type NoIdentity struct{}

NoIdentity reports no provider or model. Implements audit.ModelIdentifier.

func (NoIdentity) Identity

func (NoIdentity) Identity() (provider, model string)

type NoSink

type NoSink struct{}

NoSink discards events. Implements emitter.Sink.

func (NoSink) Write

func (NoSink) Write(event.Event)

type TemperatureOnly

type TemperatureOnly struct{}

TemperatureOnly passes just the temperature. A negative temperature means "not set": nothing is sent, so the provider's default applies (models like gpt-5 reject any temperature but their own). Implements modelcall.OptionsBuilder.

func (TemperatureOnly) Build

func (TemperatureOnly) Build(temperature float32) []model.Option

type ZeroCost

type ZeroCost struct{}

ZeroCost prices every turn at 0. Implements audit.CostEstimator.

func (ZeroCost) Estimate

func (ZeroCost) Estimate(string, string, int, int) float64

Jump to

Keyboard shortcuts

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