reasoning

package
v0.0.321 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KindUnknown   = "unknown"
	KindSummary   = "summary"
	KindRaw       = "raw"
	KindEncrypted = "encrypted"
)
View Source
const MaxReasoningTitleRunes = 80

Variables

This section is empty.

Functions

func EffectiveDisplay

func EffectiveDisplay(cfg config.ReasoningConfig) string

EffectiveDisplay resolves display=auto to the current concrete behavior and applies the raw safety gate. If raw display is requested without raw=true, it falls back to collapsed summary display.

func ExportRaw

func ExportRaw(cfg config.ReasoningConfig) bool

func ExportSummaries

func ExportSummaries(cfg config.ReasoningConfig) bool

func HistoryExpanded

func HistoryExpanded(kind string, cfg config.ReasoningConfig) bool

func HistoryMode

func HistoryMode(cfg config.ReasoningConfig) string

func HistoryVisible

func HistoryVisible(kind string, cfg config.ReasoningConfig) bool

func IsDisplayable

func IsDisplayable(kind string, cfg config.ReasoningConfig) bool

IsDisplayable reports whether classified, non-encrypted reasoning can be shown for the resolved interactive UI policy. Encrypted and unknown content remain hidden. Export has a separate stricter raw gate.

func LimitReasoningText

func LimitReasoningText(kind string, text string, cfg config.ReasoningConfig) string

func NormalizeKind

func NormalizeKind(kind string) string

func RawDisplayBlocked

func RawDisplayBlocked(cfg config.ReasoningConfig) bool

RawDisplayBlocked reports display=raw was requested without the explicit raw gate. Chat uses this to show a one-time warning while falling back to the normal collapsed interactive thought UI.

func SourceAllowsProviderThinking

func SourceAllowsProviderThinking(cfg config.ReasoningConfig) bool

SourceAllowsProviderThinking reports whether interactive surfaces may show provider-marked non-encrypted thinking blocks. This is intentionally broader than SourceAllowsRaw: raw export/replay still requires source=all, while the default summary_or_provider_safe source permits provider-classified thinking to render as a normal collapsed Thought/Thinking block.

func SourceAllowsRaw

func SourceAllowsRaw(cfg config.ReasoningConfig) bool

func SourceAllowsSummary

func SourceAllowsSummary(cfg config.ReasoningConfig) bool

func StatusEnabled

func StatusEnabled(cfg config.ReasoningConfig) bool

func SummaryBody

func SummaryBody(text string, cfg config.ReasoningConfig) string

func SummaryTitle

func SummaryTitle(text string, cfg config.ReasoningConfig) string

func TruncateRunes

func TruncateRunes(text string, maxRunes int) string

Types

type ParsedReasoningSummary

type ParsedReasoningSummary struct {
	Title string
	Body  string
}

ParsedReasoningSummary is the display-oriented shape of provider-sanctioned reasoning summary text.

func ParseReasoningSummary

func ParseReasoningSummary(text string) ParsedReasoningSummary

ParseReasoningSummary extracts an optional leading bold title block from a displayable reasoning summary. It recognizes Markdown of the form:

**Title**

Body

and the streaming partial form "**Title**". Ordinary inline bold prefixes such as "**Important:** keep this" are left untouched as body text.

Jump to

Keyboard shortcuts

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