thinking

package
v0.0.0-beta Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package thinking defines thinking levels, values, and management strategies for LLM reasoning.

Index

Constants

This section is empty.

Variables

View Source
var Levels = []string{
	string(Low),
	string(Medium),
	string(High),
}

Levels contains all valid thinking level string values.

Functions

func CycleStates

func CycleStates() []any

CycleStates returns the ordered list of states for UI cycling. false -> true -> low -> medium -> high -> false.

Types

type Level

type Level string

Level represents a thinking/reasoning level for LLM requests.

const (
	// Low enables minimal thinking.
	Low Level = "low"
	// Medium enables moderate thinking.
	Medium Level = "medium"
	// High enables maximum thinking.
	High Level = "high"
)

type Strategy

type Strategy string

Strategy defines how thinking blocks from prior turns are managed.

const (
	// Keep preserves thinking blocks as-is (default, zero value "").
	Keep Strategy = ""
	// Strip removes all thinking blocks from prior turns.
	Strip Strategy = "strip"
	// Rewrite condenses thinking blocks via a dedicated agent.
	Rewrite Strategy = "rewrite"
)

type Value

type Value struct {
	Value any // bool | string; nil = disabled
}

Value represents a thinking configuration: bool (on/off) or string level. Zero value (nil Value) means thinking is disabled.

func NewValue

func NewValue(v any) Value

NewValue creates a Value from a bool or string.

func ParseValue

func ParseValue(s string) (Value, error)

ParseValue parses a CLI string into a Value. Accepts: "off", "false", "0" -> false; "on", "true", "1" -> true; "low", "medium", "high" -> string level.

func (Value) AsString

func (t Value) AsString() string

AsString returns a human-readable string representation.

func (Value) Bool

func (t Value) Bool() bool

Bool returns true if thinking is enabled (true bool or any string level).

func (Value) IsBool

func (t Value) IsBool() bool

IsBool returns true if the value is a boolean.

func (Value) IsString

func (t Value) IsString() bool

IsString returns true if the value is a string.

func (Value) Ptr

func (t Value) Ptr() *Value

Ptr returns a pointer to a copy of Value, or nil if thinking is disabled.

func (Value) String

func (t Value) String() string

String returns the value as a string. For string levels, returns the level directly. For bool true, returns "medium" (the default reasoning level). For bool false or nil, returns "".

func (*Value) UnmarshalYAML

func (t *Value) UnmarshalYAML(unmarshal func(any) error) error

UnmarshalYAML implements yaml.Unmarshaler for Value.

Jump to

Keyboard shortcuts

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