Documentation
¶
Overview ¶
Package effort defines the canonical set of thinking-effort levels and provides per-provider mapping helpers. All provider packages should use this package instead of hard-coding effort strings.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BedrockTokens ¶
BedrockTokens maps l to a token budget for Bedrock Claude, which only supports token-based thinking budgets.
func ForAnthropic ¶
ForAnthropic returns the Anthropic output_config effort string for l. Anthropic accepts: low, medium, high, xhigh, max. xhigh is only supported by newer Claude models (e.g. Opus 4.7+). Minimal is mapped to low as the closest equivalent.
func ForGemini3 ¶
ForGemini3 returns the Gemini 3 thinking-level string for l. Gemini 3 accepts: minimal, low, medium, high.
func ForOpenAI ¶
ForOpenAI returns the OpenAI reasoning_effort string for l. OpenAI accepts: minimal, low, medium, high, xhigh.
func IsValid ¶
IsValid reports whether s is a recognised thinking_budget effort value. It accepts every Level constant, plain "adaptive", and the "adaptive/<effort>" form.
func IsValidAdaptive ¶
IsValidAdaptive reports whether sub is a valid effort for "adaptive/<sub>".
func ValidNames ¶
func ValidNames() string
ValidNames returns a human-readable list of accepted values, suitable for error messages.
Types ¶
type Level ¶
type Level string
Level represents a thinking effort level.
func NextThinkingLevel ¶ added in v1.78.0
NextThinkingLevel returns the level following current in the provider's thinking cycle, wrapping back to the first level. When current is not in the cycle the first level is returned.
func Parse ¶
Parse normalises s (case-insensitive, trimmed) and returns the matching Level. It returns ("", false) for unknown strings, adaptive values, and empty input. Use IsValid for full validation including adaptive forms.
func ThinkingCycle ¶ added in v1.78.0
ThinkingCycle returns the ordered list of selectable thinking-effort levels for the given provider type. The provider type is matched case-insensitively and tolerant of aliases (e.g. "amazon-bedrock" maps onto the underlying Anthropic family).